mirror of
https://github.com/bluekitchen/btstack.git
synced 2025-03-29 22:20:37 +00:00
re-use memory_pool_free to build initial list
This commit is contained in:
parent
df2b172626
commit
9574ad1db1
@ -52,10 +52,9 @@ void memory_pool_create(memory_pool_t *pool, void * storage, int count, int bloc
|
||||
|
||||
// create singly linked list of all available blocks
|
||||
free_blocks->next = NULL;
|
||||
for (i = 0 ; i < count ; i++, mem_ptr += block_size){
|
||||
node_t * node = (node_t*) mem_ptr;
|
||||
node->next = free_blocks->next;
|
||||
free_blocks->next = node;
|
||||
for (i = 0 ; i < count ; i++){
|
||||
memory_pool_free(pool, mem_ptr);
|
||||
mem_ptr += block_size;
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user