engine: add __restrict__ compiler attribute

Signed-off-by: Ronald Caesar <github43132@proton.me>
This commit is contained in:
Ronald Caesar
2026-01-13 18:28:39 -04:00
parent f89973d49d
commit 0b0f4bab98
2 changed files with 23 additions and 3 deletions

View File

@@ -67,6 +67,26 @@
#endif
/*!
* BAL_RESTRICT:
* Tells the compiler that a pointer does not alias any other pointer in
* current scope.
*/
#if defined(__GNUC__) || defined(__clang__)
#define BAL_RESTRICT __restrict__
#elif defined(_MSC_VER)
#define BAL_RESTRICT __restrict
#else
#define BAL_RESTRICT
#endif
#endif /* BALLISTIC_ATTRIBUTES_H */
/*** end of file ***/

View File

@@ -2,9 +2,9 @@
typedef struct
{
bal_instruction_t *instructions;
bal_bit_width_t *ssa_bit_widths;
bal_source_variable_t *source_variables;
bal_instruction_t *BAL_RESTRICT instructions;
bal_bit_width_t *BAL_RESTRICT ssa_bit_widths;
bal_source_variable_t *BAL_RESTRICT source_variables;
size_t instruction_count;
} bal_translation_context_t;