[Allocator] Factor the Allocate template overloads into a base class
authorChandler Carruth <chandlerc@gmail.com>
Tue, 15 Apr 2014 00:19:41 +0000 (00:19 +0000)
committerChandler Carruth <chandlerc@gmail.com>
Tue, 15 Apr 2014 00:19:41 +0000 (00:19 +0000)
commitebfe4d7fee96e635d2656fb664ee0b56c41d0fcc
tree1ad9360252a991628ca374b2436a8ec47d48d28e
parent40352669ba5a42c22395abf03e289c4f2ee9ec47
[Allocator] Factor the Allocate template overloads into a base class
rather than defining them (differently!) in both allocators. This also
serves as a basis for documenting and even enforcing some of the
LLVM-style "allocator" concept methods which must exist with various
signatures.

I plan on extending and changing the signatures of these to further
simplify our allocator model in subsequent commits, so I wanted to
factor things as best as I could first. Notably, I'm working to add the
'Size' to the deallocation method of all allocators. This has several
implications not the least of which are faster deallocation times on
certain allocation libraries (tcmalloc). It also will allow the JIT
allocator to fully model the existing allocation interfaces and allow
sanitizer poisoning of deallocated regions. The list of advantages goes
on. =] But by factoring things first I'll be able to make this easier by
first introducing template helpers for the deallocation path.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@206225 91177308-0d34-0410-b5e6-96231b3b80d8
include/llvm/Support/Allocator.h