helper methods for over-aligned allocation with C++ allocators
Summary: This diff adds helper methods for allocating possibly-over-aligned types using C++ allocators. It uses one of three strategies: * REBINDING - When there is a type that is not over-aligned with the requested alignment, the allocator is rebound to that a type with the correct alignment (this allows allocating 1 char with alignment 8, for example). * BYPASSING - When the requested alignment is larger than max_align_t but the standard allocator is in use, the allocator is bypassed and aligned_malloc/aligned_free are used directly to manage the allocation. * OVER-ALLOCATING - When the type is truly over-aligned and the allocator is custom, extra memory is requested and a delta is stored before the returned memory to allow the original base location to be recovered. Reviewed By: shixiao Differential Revision: D8592767 fbshipit-source-id: 487b5ff7f7f6b1b29a3f2a80d07129afd50bda24
Showing
Please register or sign in to comment