-
Notifications
You must be signed in to change notification settings - Fork 45
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add alignment block splitting to malloc_freelist
The main allocator is modified to split blocks to align them. The fundamental algorithm is mostly unchanged although there is some additional logic to calculate alignment_slack in the case that the alignment is greater than the alignment of the found block. The alignment_slack is used to split the block with the surplus returned to the freelist. Some indent has been removed from the code for readability. aligned_free is now redundant but it is kept for compatibility. It is no longer necessary to unwrap an offset field in wrapper headers as the main allocation header block is aligned and free can be called directly on aligned allocations, so aligned_free now simply delegates to free(). The documentation is updated to reflect these changes.
- Loading branch information
1 parent
4ab8b7a
commit f758bd4
Showing
3 changed files
with
93 additions
and
115 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