diff options
| author | Douglas B. Rumbaugh <doug@douglasrumbaugh.com> | 2025-11-02 18:29:43 -0500 |
|---|---|---|
| committer | Douglas B. Rumbaugh <doug@douglasrumbaugh.com> | 2025-11-02 18:29:43 -0500 |
| commit | b315442b947dbf4909ca03e4fff2548493ceff9c (patch) | |
| tree | 85e35491f8d47fecf0f5132a64904ca1403b091f | |
| parent | 11521b99661f969ba7adad9d2366108a1a001ab0 (diff) | |
| download | liballoc-b315442b947dbf4909ca03e4fff2548493ceff9c.tar.gz | |
free_list: Update header sizes when coalescing free blocks
| -rw-r--r-- | src/free_list.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/src/free_list.c b/src/free_list.c index 0ecb23f..bc93196 100644 --- a/src/free_list.c +++ b/src/free_list.c @@ -60,6 +60,7 @@ void fl_coalesce_nodes(free_nd *free_list) { for (free_nd *nd = free_list; nd; nd = nd->next) { if ((size_t)nd + sizeof(header) + nd->size == (size_t)nd->next) { nd->size += sizeof(header) + nd->next->size; + ((header *)((void *)nd - sizeof(header)))->size += sizeof(header) + nd->next->size; nd->next = nd->next->next; } } |