src/oldpool.h
branchcpp_gui
changeset 6298 c30fe89622df
parent 5838 9c3129cb019b
child 6303 84c215fc8eb8
equal deleted inserted replaced
6297:4bf29d14edba 6298:c30fe89622df
     1 /* $Id$ */
     1 /* $Id$ */
     2 
     2 
     3 #ifndef OLDPOOL_H
     3 #ifndef OLDPOOL_H
     4 #define OLDPOOL_H
     4 #define OLDPOOL_H
     5 
     5 
     6 typedef struct OldMemoryPool OldMemoryPool;
     6 struct OldMemoryPool;
     7 
     7 
     8 /* The function that is called after a new block is added
     8 /* The function that is called after a new block is added
     9      start_item is the first item of the new made block */
     9      start_item is the first item of the new made block */
    10 typedef void OldMemoryPoolNewBlock(uint start_item);
    10 typedef void OldMemoryPoolNewBlock(uint start_item);
    11 /* The function that is called before a block is cleaned up */
    11 /* The function that is called before a block is cleaned up */
    66 			_##name##_pool.blocks[index >> name##_POOL_BLOCK_SIZE_BITS] + \
    66 			_##name##_pool.blocks[index >> name##_POOL_BLOCK_SIZE_BITS] + \
    67 			(index & ((1 << name##_POOL_BLOCK_SIZE_BITS) - 1)) * sizeof(type) \
    67 			(index & ((1 << name##_POOL_BLOCK_SIZE_BITS) - 1)) * sizeof(type) \
    68 		); \
    68 		); \
    69 	} \
    69 	} \
    70 \
    70 \
    71 	static inline uint Get##name##PoolSize(void) \
    71 	static inline uint Get##name##PoolSize() \
    72 	{ \
    72 	{ \
    73 		return _##name##_pool.total_items; \
    73 		return _##name##_pool.total_items; \
    74 	}
    74 	}
    75 
    75 
    76 
    76