def.h 842 B

12345678910111213141516171819202122232425262728293031
  1. #ifndef DEF_H
  2. #define DEF_H
  3. #include <assert.h>
  4. #include <stdatomic.h>
  5. #include <stdint.h>
  6. #include <stdlib.h>
  7. #include <stdio.h>
  8. #include <strings.h>
  9. #include <stdbool.h>
  10. #include <omp.h>
  11. // simple logging primitives (that should be optimized away when disabled)
  12. // use true/false to enable/disable detailed logging
  13. #define DEBUG false
  14. #define TRACE(x) do { if (DEBUG) x; } while (0)
  15. #define VERIFY false
  16. // max long long unsigned int
  17. #define MAX_LLUINT (0llu - 1llu)
  18. // max pointer value
  19. #define MAX_POINTER ((void*) MAX_LLUINT)
  20. // pointer masks everything but the two highest bits
  21. #define MASK_POINTER (MAX_LLUINT - (3llu << (sizeof(void*) * 8 - 2)))
  22. // mark1 masks the highest bit
  23. #define MASK_MARK1 (1llu << (sizeof(void*) * 8 - 1))
  24. // mark2 masks the second highest bit
  25. #define MASK_MARK2 (1llu << (sizeof(void*) * 8 - 2))
  26. #endif