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
Showing
Please register or sign in to comment