src/settings.cpp
changeset 8423 8453e9a0f0b5
parent 8418 b49fc6be1ab9
child 8424 4a488a90ccab
equal deleted inserted replaced
8422:cab41009c86e 8423:8453e9a0f0b5
    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 */