From cffbb15757defee44b14286dd5af40f95e341471 Mon Sep 17 00:00:00 2001 From: Moon Flower Date: Sat, 23 Aug 2025 22:29:30 +0330 Subject: formatting + changed static to malloc --- pu2/pu2.out.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'pu2/pu2.out.c') diff --git a/pu2/pu2.out.c b/pu2/pu2.out.c index baae8f2..eb6badb 100644 --- a/pu2/pu2.out.c +++ b/pu2/pu2.out.c @@ -10,7 +10,7 @@ // clang-format on /* -- BEGIN COMPILE TIME FLAGS -- */ -// #define PU2_NO_MMAP +#define PU2_NO_MMAP // #define PU2_NO_ASM // #define PU2_NO_INTRINSICS // #define PU2_BAD_CLOCK @@ -97,12 +97,8 @@ #define likely(JJ) (JJ) #endif - #ifndef PU2_NO_MMAP __attribute__((aligned(64))) int *m; - #else -__attribute__((aligned(64))) int m[ S ]; - #endif -int a, b, u, c; +int a, b, u, c; typedef struct { int c; int v; @@ -145,6 +141,12 @@ void init_pu2() { page_count); exit(1); } + #else + m = malloc(S * sizeof(int)); + if(m == NULL) { + perror("[error] failed to allocate pu2 memory"); + exit(1); + } #endif // size_t i; -- cgit v1.2.3