aboutsummaryrefslogtreecommitdiff
path: root/pu2/pu2.out.c
diff options
context:
space:
mode:
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;