mirror of
https://github.com/llvm/llvm-project.git
synced 2025-04-25 20:06:05 +00:00

PerThreadBumpPtrAllocator allows separating allocations by thread id. That makes allocations race free. It is possible because ThreadPoolExecutor class creates threads, keeps them until the destructor of ThreadPoolExecutor is called, and assigns ids to the threads. Thus PerThreadBumpPtrAllocator should be used with only threads created by ThreadPoolExecutor. This allocator is useful when thread safe BumpPtrAllocator is needed. Reviewed By: MaskRay, dexonsmith, andrewng Differential Revision: https://reviews.llvm.org/D142318