equal
deleted
inserted
replaced
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 |