Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

memory chunk cannot be merged when being freed #14

Open
byeyear opened this issue Sep 20, 2020 · 0 comments
Open

memory chunk cannot be merged when being freed #14

byeyear opened this issue Sep 20, 2020 · 0 comments

Comments

@byeyear
Copy link

byeyear commented Sep 20, 2020

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant