Skip to content

memory chunk cannot be merged when being freed #14

@byeyear

Description

@byeyear

On line 71 in heap.c of current version, when the node being freed is the start of the heap, we still need to check whether it can be merged with its next chunk. For example:

p = heap_alloc(heap, 100);
heap_free(heap, p);

After this 2 lines, the whole heap is still splitted into 2 free chunks, but the 2 free chunks should be merged into 1.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions