The default of doubling the slab size only each 128 slabs seems very
conservative, at least for some use cases. If the allocator gets
asked for memory totalling 10MiB, it'll allocate 128*4096=0.5MiB
memory before it finally doubles the slab size, then will
allocate 128*8192=1MiB before doubling again, etc. A pathological
case is lldb's ConstString class, which uses a hashmap with 256
allocators, which means that when debugging a huge C++ project
the allocators will do thousands and thousands of small allocations
before they finally find out they need to allocate large amounts
of memory. See https://reviews.llvm.org/D68549 .
Details
Details
- Reviewers
chandlerc
Diff Detail
Diff Detail
- Repository
- rL LLVM