equal
deleted
inserted
replaced
95 static void *pool_alloc(SettingsMemoryPool **pool, uint size) |
95 static void *pool_alloc(SettingsMemoryPool **pool, uint size) |
96 { |
96 { |
97 uint pos; |
97 uint pos; |
98 SettingsMemoryPool *p = *pool; |
98 SettingsMemoryPool *p = *pool; |
99 |
99 |
100 size = ALIGN(size, sizeof(void*)); |
100 size = Align(size, sizeof(void*)); |
101 |
101 |
102 /* first check if there's memory in the next pool */ |
102 /* first check if there's memory in the next pool */ |
103 if (p->next && p->next->pos + size <= p->next->size) { |
103 if (p->next && p->next->pos + size <= p->next->size) { |
104 p = p->next; |
104 p = p->next; |
105 /* then check if there's not memory in the cur pool */ |
105 /* then check if there's not memory in the cur pool */ |