Refactor the pooled ArenaAllocator.
authorPat Gavlin <pagavlin@microsoft.com>
Fri, 26 Feb 2016 19:17:03 +0000 (11:17 -0800)
committerPat Gavlin <pagavlin@microsoft.com>
Mon, 29 Feb 2016 17:47:31 +0000 (09:47 -0800)
commit688e7869d18be350f3e32b6a6bd8f347d722b3dd
tree90b4cb8fd738a1b6d860fb9573f9ccbac72f44c4
parent876ab1b42e9b489f3fbd0a37fca7559cf91eb836
Refactor the pooled ArenaAllocator.

The mark/release functionality on `ArenaAllocator` was only being used by the pooled
allocator, and caused some complications in API and implementation. Instead of
providing this functionality on all allocators, refactor this functionality out of
`ArenaAllocator` and into a new subclass, `PooledAllocator`, that provides the
singleton pooled allocator.

A number of additional usability/reliability changes have been enabled as part of this
change:
- `ArenaAllocator::initialize` has been replaced with move assignment
- Asserts have been added on all relevant instance methods to ensure that
  `ArenaAllocator` values are initialized before use
- `ArenaAllocator::returnPooledAllocator` has been replaced by making
  `ArenaAllocator::destroy` virtual and having `PooledAllocator::destroy` return the
  singleton
- The teardown of the pooled allocator is now thread-safe w.r.t. the shutdown of the
  arena allocator subsystem
src/jit/alloc.cpp
src/jit/alloc.h
src/jit/compiler.cpp