Skip to content

Update memalloc.c #4

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

ReinierMaas
Copy link

The previous implementation releases only the last element.
The new implementation releases all free elements that are trailing.

Test 1 =>

  • make allocations
  • remove them FiLo (inverted order of creation)
  • the entire heap is returned to system

Test 2 =>

  • make allocations
  • remove them FiFo (order of creation)
  • only the size of the last removed element is returned to system
  • with the changes the entire heap is returned to system

The previous implementation releases only the last element.
The new implementation releases all free elements that are trailing.

Test 1 =>
* make allocations
* remove them FiLo (inverted order of creation)
* the entire heap is returned to system

Test 2 => 
* make allocations
* remove them FiFo (order of creation)
* only the size of the last removed element is returned to system
- with the changes the entire heap is returned to system
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

Successfully merging this pull request may close these issues.

1 participant