comparison runtime/fixed_alloc.h @ 95:f4fd8962c385

Cleaned up binary trees benchmark, made memory allocator somewhat configurable at compile time
author Mike Pavone <pavone@retrodev.com>
date Mon, 02 Aug 2010 01:55:56 -0400
parents e73a93fb5de1
children 43cc42df26cc
comparison
equal deleted inserted replaced
94:05c22ff4b4ed 95:f4fd8962c385
6 #include "block_alloc.h" 6 #include "block_alloc.h"
7 7
8 #define GET_BLOCK(ptr) ((void*)(((uintptr_t)(ptr))&(~((uintptr_t)(BLOCK_SIZE-1))))) 8 #define GET_BLOCK(ptr) ((void*)(((uintptr_t)(ptr))&(~((uintptr_t)(BLOCK_SIZE-1)))))
9 9
10 #define MAX_SIZE (BLOCK_SIZE/32) 10 #define MAX_SIZE (BLOCK_SIZE/32)
11 #ifndef STRIDE
11 #define STRIDE (BLOCK_SIZE/1024) 12 #define STRIDE (BLOCK_SIZE/1024)
13 #endif
14 #ifndef MIN_SIZE
12 #define MIN_SIZE (BLOCK_SIZE/1024) 15 #define MIN_SIZE (BLOCK_SIZE/1024)
16 #endif
17 #ifndef MAX_FREE
13 #define MAX_FREE 64 18 #define MAX_FREE 64
19 #endif
14 20
15 #define ADJUST_SIZE(requested) (((requested)+(STRIDE-1)) & (~(STRIDE-1))) 21 #define ADJUST_SIZE(requested) (((requested)+(STRIDE-1)) & (~(STRIDE-1)))
16 22
17 23
18 #pragma pack(push,1) 24 #pragma pack(push,1)