|
10 | 10 | namespace Sass {
|
11 | 11 |
|
12 | 12 | // Move this to somewhere else, should be global
|
13 |
| - constexpr size_t SASS_MEM_ALIGN = sizeof(unsigned int); |
| 13 | + #define SASS_MEM_ALIGN sizeof(unsigned int) |
14 | 14 |
|
15 | 15 | inline static size_t align2(size_t n) {
|
16 | 16 | return (n + SASS_MEM_ALIGN - 1) & ~(SASS_MEM_ALIGN - 1);
|
@@ -54,25 +54,25 @@ namespace Sass {
|
54 | 54 |
|
55 | 55 |
|
56 | 56 | // The size of the memory pool arenas in bytes.
|
57 |
| - constexpr static size_t SassAllocatorArenaSize = 1024 * 256; |
| 57 | + #define SassAllocatorArenaSize (1024 * 256) |
58 | 58 |
|
59 | 59 | // How many buckets should we have for the freelist
|
60 | 60 | // Determines when allocations go directly to malloc/free
|
61 | 61 | // For maximum size of managed items multiply by alignment
|
62 |
| - constexpr static size_t SassAllocatorBuckets = 512; |
| 62 | +#define SassAllocatorBuckets 512 |
63 | 63 |
|
64 | 64 | // The alignment for the memory fragments. Must be a multiple
|
65 | 65 | // of `SASS_MEM_ALIGN` and should not be too big (maybe 1 or 2)
|
66 |
| - constexpr static size_t SassAllocatorAlignment = SASS_MEM_ALIGN * 2; |
| 66 | +#define SassAllocatorAlignment (SASS_MEM_ALIGN * 2) |
67 | 67 |
|
68 | 68 | // The number of bytes we use for our book-keeping before every
|
69 | 69 | // memory fragment. Needed to know to which bucket we belongs on
|
70 | 70 | // deallocations, or if it should go directly to the `free` call.
|
71 |
| - constexpr size_t SassAllocatorBookSize = sizeof(unsigned int); |
| 71 | +#define SassAllocatorBookSize sizeof(unsigned int) |
72 | 72 |
|
73 | 73 | // Bytes reserve for book-keeping on the arenas
|
74 | 74 | // Currently unused and for later optimization
|
75 |
| - constexpr size_t SassAllocatorArenaHeadSize = 0; |
| 75 | +#define SassAllocatorArenaHeadSize 0 |
76 | 76 |
|
77 | 77 | class MemoryPool {
|
78 | 78 |
|
|
0 commit comments