You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Investigate rounding up allocations to at least two words, and making the free list doubly linked.
Motivation
This could simplify code, maybe shrink code size, and lessen fragmentation.
Details
We could remove deferred consolidation of cells. Simplifying code and hopefully also shrinking code size.
We could always consolidate a free cell with both of its neighbors, if they are also free. Right now we can only do one or the other because the free list is singly linked, and doesn't afford these kinds of manipulations in O(1) time.
Downside is that heap allocations of size < 2 words get rounded up. I think this is probably an OK choice.
We would make FreeCell have another link prev_free_raw that is the previous free list pointer.
Anywhere we insert into or remove from the free list, we would need to make sure that the new link is kept valid.
Happy to mentor anyone who wants to try their hand at this!
The text was updated successfully, but these errors were encountered:
fitzgen
changed the title
Investigate rounding up allocations to at least two words, and making the free list doubly linked
Investigate making the free list doubly linked
Feb 23, 2018
Summary
Investigate rounding up allocations to at least two words, and making the free list doubly linked.
Motivation
This could simplify code, maybe shrink code size, and lessen fragmentation.
Details
We could remove deferred consolidation of cells. Simplifying code and hopefully also shrinking code size.
We could always consolidate a free cell with both of its neighbors, if they are also free. Right now we can only do one or the other because the free list is singly linked, and doesn't afford these kinds of manipulations in O(1) time.
Downside is that heap allocations of
size < 2 words
get rounded up. I think this is probably an OK choice.We would make
FreeCell
have another linkprev_free_raw
that is the previous free list pointer.Anywhere we insert into or remove from the free list, we would need to make sure that the new link is kept valid.
Happy to mentor anyone who wants to try their hand at this!
The text was updated successfully, but these errors were encountered: