-
Notifications
You must be signed in to change notification settings - Fork 5.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use sized deallocation in SysAllocator and Arena (2nd try)
Summary: Use sized-deallocation (`sdallocx`) if possible in `folly::SysAllocator` and `folly::Arena`. `Arena` has always allocated two types of blocks: 1. Normal (fixed-sized): size is the "goodSize adjusted" `minBlockSize` 2. Large (variable-sized): when #1 is too small Type #2 makes sized-deallocation tricky -- we need somewhere to remember the allocated sizes. The old code used a single type `Block` and kept a single list. Here I change to have two types and two lists. The `LargeBlock` has an additional `allocSize` data member. This makes the Arena object itself 16B larger, but seems better than adding a 4B `allocSize` to each and every block, regardless of type. Note that, prior to this change, it was possible to `merge()` arenas with different `minBlockSize`. This is no longer possible. Reviewed By: davidtgoldblatt Differential Revision: D22466906 fbshipit-source-id: 719f357a0a1f6cfcda3208391837195c3859ab69
- Loading branch information
1 parent
e9a34c0
commit b99077f
Showing
4 changed files
with
66 additions
and
48 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
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