3 * $Id: allocator.h 105 1998-12-10 17:48:53Z 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
35 #define ALIGN 3 /* 64bit alignment */
36 //#define ALIGN 2 /* 32bit allignment */
38 #define EXACT_TOP_BIT 8 /* usually somewhere in the range [8..10]
39 the largest exact chunk is 1 << EXACT_TOP_BIT bytes large &
40 there'll be 1 << (EXACT_TOP_BIT - ALIGN) exact bins
42 Supported values are between 0 and 16...
43 ...any value less than ALIGN mean "no exact bins"...
44 ...actually, there'll be a very small first bin containing
45 chunks exactly allocationblock sized.
47 Setting EXACT_TOP_BIT to anything less than (SUBBIT + ALIGN)
48 doesn't really make sense either, but is possible...
51 /* check EXACT_TOP_BIT early ... */
53 #if (EXACT_TOP_BIT > 16)
54 # warning "EXACT_TOP_BIT > 16: bad idea & unsupported value; using 16"
56 # define EXACT_TOP_BIT 16
60 #if EXACT_TOP_BIT >= ALIGN
61 # define EXACT (EXACT_TOP_BIT - ALIGN)
65 #define LARGE (ADDRESS - EXACT - ALIGN)
67 #define SUBBIT 0 /* set this to 0 to disable the additional hashing for the large bins;
68 otherwise, good values are in the range [3..5]; the best setting for
69 a particular application is highly dependent on the VM's heap-size
70 and the cache sizes. Remember, the allocator will create
71 (LARGE << SUBBIT) sorted bins. In the case of a 64bit machine with
72 256 exact bins (EXACT_TOP_BIT == 9), a SUBBIT setting of 3 will
73 create 64-9=55 bins consisting of 2^3=8 subbins; thus, a pointer
74 array with 55*8 fields will be allocated, eating up 3520 bytes. */
79 # warning "SUBBIT < 0: using 0."
84 #if (SUBBIT > (EXACT_TOP_BIT - ALIGN))
85 # warning "SUBBIT > (EXACT_TOP_BIT - ALIGN): wasting subbins!"
88 #if (((LARGE << SUBBIT) << ALIGN) > (1 << 16))
89 # warning "((LARGE << SUBBIT) << ALIGN) > 64K: are you sure you want it this big??"
92 typedef struct freeblock_exact {
93 struct freeblock_exact* next;
96 typedef struct freeblock_large {
98 struct freeblock_large* next;
102 void allocator_free(void* chunk, SIZE size);
103 void* allocator_alloc(SIZE size);
104 void allocator_init(void);
105 void allocator_reset(void);
107 void allocator_mark_free_kludge(BITBLOCK* bitmap);
109 unsigned char find_highest(SIZE bits);
111 #endif /* !defined(__allocator_h_) */
115 * These are local overrides for various environment variables in Emacs.
116 * Please do not remove this and leave it at the end of the file, where
117 * Emacs will automagically detect them.
118 * ---------------------------------------------------------------------
121 * indent-tabs-mode: t