12345678910111213141516171819202122232425262728293031 |
- #ifndef DEF_H
- #define DEF_H
- #include <assert.h>
- #include <stdatomic.h>
- #include <stdint.h>
- #include <stdlib.h>
- #include <stdio.h>
- #include <strings.h>
- #include <stdbool.h>
- #include <omp.h>
- // simple logging primitives (that should be optimized away when disabled)
- // use true/false to enable/disable detailed logging
- #define DEBUG false
- #define TRACE(x) do { if (DEBUG) x; } while (0)
- #define VERIFY false
- // max long long unsigned int
- #define MAX_LLUINT (0llu - 1llu)
- // max pointer value
- #define MAX_POINTER ((void*) MAX_LLUINT)
- // pointer masks everything but the two highest bits
- #define MASK_POINTER (MAX_LLUINT - (3llu << (sizeof(void*) * 8 - 2)))
- // mark1 masks the highest bit
- #define MASK_MARK1 (1llu << (sizeof(void*) * 8 - 1))
- // mark2 masks the second highest bit
- #define MASK_MARK2 (1llu << (sizeof(void*) * 8 - 2))
- #endif
|