-
Notifications
You must be signed in to change notification settings - Fork 53
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Safely keep track of pending extensions to the Heap
This makes Heap::extend correct and fully infallible. To make this work, a slight change to the usable size of the last Hole needed to happen. Significant changes: - pending_extend added to HoleList, tracks impartial extension amounts - for odd-sized heaps or extensions, the last Hole will only utilize space up to the highest usize-aligned address - the above change forces top to always be aligned to usize - the correctness of `extend` relies on an aligned top pointer, so a debug assertion is added to catch any future code changes - Heap::size() reports usable size for allocations (updated some tests accordingly) - pub fn Heap::top() reports top-most pointer of memory claimed by the Heap, even if thost last bytes aren't usable yet. (private field HoleList.top still is always aligned) - documented best values to give to extend - removed ExtendError and try_extend
- Loading branch information
1 parent
c7e3428
commit ede19c8
Showing
3 changed files
with
99 additions
and
109 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters