We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent d6232aa commit 877f973Copy full SHA for 877f973
lib/malloc.c
@@ -109,15 +109,13 @@ void free(void *ptr)
109
static void selective_coalesce(void)
110
{
111
memblock_t *p = first_free;
112
- uint32_t coalesced = 0;
113
114
while (p && p->next) {
115
/* Merge only when blocks are FREE *and* adjacent in memory */
116
uint8_t *pend = (uint8_t *) p + sizeof(memblock_t) + GET_SIZE(p);
117
if (!IS_USED(p) && !IS_USED(p->next) && pend == (uint8_t *) p->next) {
118
p->size = GET_SIZE(p) + sizeof(memblock_t) + GET_SIZE(p->next);
119
p->next = p->next->next;
120
- coalesced++;
121
free_blocks_count--;
122
} else {
123
p = p->next;
0 commit comments