3 * $Id: allocator.h 115 1999-01-20 01:52:45Z phil $
18 #define COUNT_ALLOCATIONS NO
20 #define FASTER_FAIL NO
23 #define SMALL_TABLES YES
24 #define MSB_TO_LSB_SEARCH NO
30 # define SIZE unsigned long long
32 # define SIZE unsigned long
36 #define ALIGN 3 /* 64bit alignment */
37 //#define ALIGN 2 /* 32bit allignment */
39 #define EXACT_TOP_BIT 8 /* usually somewhere in the range [8..10]
40 the largest exact chunk is 1 << EXACT_TOP_BIT bytes large &
41 there'll be 1 << (EXACT_TOP_BIT - ALIGN) exact bins
43 Supported values are between 0 and 16...
44 ...any value less than ALIGN mean "no exact bins"...
45 ...actually, there'll be a very small first bin containing
46 chunks exactly allocationblock sized.
48 Setting EXACT_TOP_BIT to anything less than (SUBBIT + ALIGN)
49 doesn't really make sense either, but is possible...
52 /* check EXACT_TOP_BIT early ... */
54 #if (EXACT_TOP_BIT > 16)
55 # warning "EXACT_TOP_BIT > 16: bad idea & unsupported value; using 16"
57 # define EXACT_TOP_BIT 16
61 #if EXACT_TOP_BIT >= ALIGN
62 # define EXACT (EXACT_TOP_BIT - ALIGN)
66 #define LARGE (ADDRESS - EXACT - ALIGN)
68 #define SUBBIT 0 /* set this to 0 to disable the additional hashing for the large bins;
69 otherwise, good values are in the range [3..5]; the best setting for
70 a particular application is highly dependent on the VM's heap-size
71 and the cache sizes. Remember, the allocator will create
72 (LARGE << SUBBIT) sorted bins. In the case of a 64bit machine with
73 256 exact bins (EXACT_TOP_BIT == 9), a SUBBIT setting of 3 will
74 create 64-9=55 bins consisting of 2^3=8 subbins; thus, a pointer
75 array with 55*8 fields will be allocated, eating up 3520 bytes. */
80 # warning "SUBBIT < 0: using 0."
85 #if (SUBBIT > (EXACT_TOP_BIT - ALIGN))
86 # warning "SUBBIT > (EXACT_TOP_BIT - ALIGN): wasting subbins!"
89 #if (((LARGE << SUBBIT) << ALIGN) > (1 << 16))
90 # warning "((LARGE << SUBBIT) << ALIGN) > 64K: are you sure you want it this big??"
93 typedef struct freeblock_exact {
94 struct freeblock_exact* next;
97 typedef struct freeblock_large {
99 struct freeblock_large* next;
103 void allocator_free(void* chunk, SIZE size);
104 void* allocator_alloc(SIZE size);
105 void allocator_init(void);
106 void allocator_reset(void);
108 void allocator_mark_free_kludge(BITBLOCK* bitmap);
110 /* unsigned char find_highest(SIZE bits); */
112 #endif /* !defined(__allocator_h_) */
116 * These are local overrides for various environment variables in Emacs.
117 * Please do not remove this and leave it at the end of the file, where
118 * Emacs will automagically detect them.
119 * ---------------------------------------------------------------------
122 * indent-tabs-mode: t