settings.c
changeset 2450 d7edd1def1e0
parent 2398 912f16512ce2
child 2456 2317dd6f4b19
equal deleted inserted replaced
2449:bcbfed6d3f58 2450:d7edd1def1e0
    48 static void *pool_alloc(SettingsMemoryPool **pool, uint size)
    48 static void *pool_alloc(SettingsMemoryPool **pool, uint size)
    49 {
    49 {
    50 	uint pos;
    50 	uint pos;
    51 	SettingsMemoryPool *p = *pool;
    51 	SettingsMemoryPool *p = *pool;
    52 
    52 
    53 	size = ALIGN(size, 4); // align everything to a 32 bit boundary
    53 	size = ALIGN(size, sizeof(void*));
    54 
    54 
    55 	// first check if there's memory in the next pool
    55 	// first check if there's memory in the next pool
    56 	if (p->next && p->next->pos + size <= p->next->size) {
    56 	if (p->next && p->next->pos + size <= p->next->size) {
    57 		p = p->next;
    57 		p = p->next;
    58 	// then check if there's not memory in the cur pool
    58 	// then check if there's not memory in the cur pool