aboutsummaryrefslogtreecommitdiff
path: root/pu2/pu2.out.c
diff options
context:
space:
mode:
authorGravatar Moon Flower <moon@coffin.ir> 2025-08-23 22:29:30 +0330
committerGravatar Moon Flower <moon@coffin.ir> 2025-08-23 22:29:30 +0330
commitcffbb15757defee44b14286dd5af40f95e341471 (patch)
tree5138318bd44d15acb480a6727802f282ad25b923 /pu2/pu2.out.c
parentnew flag (diff)
formatting + changed static to malloc
Diffstat (limited to 'pu2/pu2.out.c')
-rw-r--r--pu2/pu2.out.c14
1 files changed, 8 insertions, 6 deletions
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;