refactor code for per-arena allocators
commit88f5f458eb81b1be99ae1cc9234a8ea5aee8043e
authorBin Liu <binliu@fb.com>
Wed, 29 May 2019 21:47:31 +0000 (29 14:47 -0700)
committerHhvm Bot <hhvm-bot@users.noreply.github.com>
Wed, 29 May 2019 21:51:20 +0000 (29 14:51 -0700)
tree070b9fccebc9d02f88d2533e236df3b1fc6338b6
parentf6eebe3512f3ab43d82ba189622129509ba3aeae
refactor code for per-arena allocators

Summary:
use macros, templates to avoid duplicating code.

The *_malloc/free functions assume size isn't 0, which works because when we call the functions in our code, the size is never zero.
The C++ allocators do check 0/nullptr before calling the alloc/sized_free functions.

Reviewed By: markw65

Differential Revision: D15429218

fbshipit-source-id: 0bca36b2f7c059a8ed1f618c7109f08814d4e889
hphp/util/alloc.h