Harden usingJEMalloc()
authorTudor Bosman <tudorb@fb.com>
Wed, 19 Mar 2014 04:57:17 +0000 (21:57 -0700)
committerDave Watson <davejwatson@fb.com>
Mon, 31 Mar 2014 17:44:00 +0000 (10:44 -0700)
commitcd83842807030372e24df337fc9958f5f7f3ba37
tree8eea129c6588d9f8a4706de914b7a70e396fde9b
parentd9c79af86a4dc0576d8df453804d3354347c07dc
Harden usingJEMalloc()

Summary:
In a shared library, we're using whichever memory allocator the main program
uses, but we may still believe we're using jemalloc if we load libjemalloc.so
(because rallocm is defined). This means we'll pass to rallocm pointers that
were not allocated by jemalloc, which is bad.

Test Plan: tests added

Reviewed By: ngbronson@fb.com

FB internal diff: D1228483
folly/Makefile.am
folly/Malloc.cpp [new file with mode: 0644]
folly/Malloc.h
folly/detail/Malloc.cpp
folly/detail/Malloc.h