Changeset 6be0cf9 for src/examples/gc_no_raii/src/internal/globals.h
- Timestamp:
- Jan 19, 2016, 4:07:06 PM (9 years ago)
- Branches:
- ADT, aaron-thesis, arm-eh, ast-experimental, cleanup-dtors, ctor, deferred_resn, demangler, enum, forall-pointer-decay, gc_noraii, jacob/cs343-translation, jenkins-sandbox, master, memory, new-ast, new-ast-unique-expr, new-env, no_list, persistent-indexer, pthread-emulation, qualifiedEnum, resolv-new, with_gc
- Children:
- 08a40fd
- Parents:
- a2b2761
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/examples/gc_no_raii/src/internal/globals.h
ra2b2761 r6be0cf9 1 1 #pragma once 2 2 3 #include <stddef.h> 4 #include <stdint.h> 3 // #include <stddef.h> 4 // #include <stdint.h> 5 // 6 // static const size_t POOL_SIZE_EXP = 24; 7 // static const size_t POOL_SIZE_BYTES = 0x1 << POOL_SIZE_EXP; 8 // static const size_t POOL_PTR_MASK = ~(POOL_SIZE_BYTES - 1); 9 // 10 // static const size_t CARDS_SIZE_EXP = 12; 11 // static const size_t CARDS_SIZE_BYTES = 0x1 << CARDS_SIZE_EXP; 12 // static const size_t CARDS_OFFSET_MASK = (~(CARDS_SIZE_BYTES - 1)) & (POOL_SIZE_BYTES - 1); 13 // static const size_t CARDS_COUNT = POOL_SIZE_BYTES / CARDS_SIZE_BYTES; 14 // 15 // static const size_t OBJECT_ALLIGNMENT = sizeof(size_t); 16 // static const size_t OBJECT_PTR_MASK = ~(OBJECT_ALLIGNMENT - 1); 5 17 6 static const size_t POOL_SIZE_EXP = 24;7 static const size_t POOL_SIZE_BYTES = 0x1 << POOL_SIZE_EXP;8 static const size_t POOL_PTR_MASK = ~(POOL_SIZE_BYTES - 1);9 18 10 static const size_t CARDS_SIZE_EXP = 12; 11 static const size_t CARDS_SIZE_BYTES = 0x1 << CARDS_SIZE_EXP; 12 static const size_t CARDS_OFFSET_MASK = (~(CARDS_SIZE_BYTES - 1)) & (POOL_SIZE_BYTES - 1); 13 static const size_t CARDS_COUNT = POOL_SIZE_BYTES / CARDS_SIZE_BYTES; 19 #define POOL_SIZE_EXP 24 20 #define POOL_SIZE_BYTES 0x1 << POOL_SIZE_EXP 21 #define POOL_PTR_MASK ~(POOL_SIZE_BYTES - 1) 14 22 15 static const size_t OBJECT_ALLIGNMENT = sizeof(size_t); 16 static const size_t OBJECT_PTR_MASK = ~(OBJECT_ALLIGNMENT - 1); 23 #define CARDS_SIZE_EXP 12 24 #define CARDS_SIZE_BYTES 0x1 << CARDS_SIZE_EXP 25 #define CARDS_OFFSET_MASK (~(CARDS_SIZE_BYTES - 1)) & (POOL_SIZE_BYTES - 1) 26 #define CARDS_COUNT POOL_SIZE_BYTES / CARDS_SIZE_BYTES 27 28 #define OBJECT_ALLIGNMENT sizeof(size_t) 29 #define OBJECT_PTR_MASK ~(OBJECT_ALLIGNMENT - 1)
Note: See TracChangeset
for help on using the changeset viewer.