Mercurial > repos > rhope
comparison runtime/fixed_alloc.h @ 92:e73a93fb5de1
Beginning of port of compiler to itself, some bugfixes and a refcount optimization
author | Mike Pavone <pavone@retrodev.com> |
---|---|
date | Mon, 02 Aug 2010 00:58:55 -0400 |
parents | 5a195ee08eac |
children | f4fd8962c385 |
comparison
equal
deleted
inserted
replaced
91:bcdc326b3d6e | 92:e73a93fb5de1 |
---|---|
26 #pragma pack(pop) | 26 #pragma pack(pop) |
27 | 27 |
28 //num_elements = (BLOCK_SIZE - sizeof(mem_block)+1)*8/(sizeof(element)*8+1) | 28 //num_elements = (BLOCK_SIZE - sizeof(mem_block)+1)*8/(sizeof(element)*8+1) |
29 typedef struct { | 29 typedef struct { |
30 mem_block *freelist; | 30 mem_block *freelist; |
31 mem_block *inuse[(MAX_SIZE-MIN_SIZE)/STRIDE]; | 31 mem_block *inuse[(MAX_SIZE-MIN_SIZE)/STRIDE+1]; |
32 uint32_t freecount; | 32 uint32_t freecount; |
33 uint32_t fullcount; | 33 uint32_t fullcount; |
34 } mem_manager; | 34 } mem_manager; |
35 | 35 |
36 void fixed_alloc_init(); | 36 void fixed_alloc_init(); |