[PATCH] D75281: BumpPtrAllocator: Use extern templates and out of line methods

Hans Wennborg via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Feb 27 12:23:26 PST 2020


hans added a comment.

I thought we wanted BumpPtrAllocatorImpl<>::Allocate to be inline though, so that Size and Alignment could often be constant folded, and so that the fast path (when the allocation fits in the current slab) becomes small and fast.

Also, how does the extern template work here? It looks like you're declaring/defining it with the default template parameters. If someone instantiates it with other parameters, where will they get the Allocate() definition from? If it's never instantiated with the non-default params, maybe it shouldn't be a template in the first place -- this would be my preferred solution because it's remarkably complicated for a quick bump allocator.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D75281/new/

https://reviews.llvm.org/D75281





More information about the llvm-commits mailing list