Fix large size class category handling in folly::goodMallocSize()
authorTomislav Novak <tnovak@fb.com>
Fri, 24 Oct 2014 18:46:51 +0000 (11:46 -0700)
committerPavlo Kushnir <pavlo@fb.com>
Sat, 8 Nov 2014 02:20:04 +0000 (18:20 -0800)
commit3bcf918f9140d6478cfc0c283523d210d20cff61
tree4c2abae935f082d4452d35e6b02eb9f43dbf84e8
parent5ea13370592a6dcdb5a90ee1d89273162bda960d
Fix large size class category handling in folly::goodMallocSize()

Summary:
jemalloc seems to now use `4064 * 1024` as `arena_maxclass`. Therefore,
allocations that fall in the range `(4064*1024, 4072*1024]` will trigger an
assert in `folly::goodMallocSize()` (`nallocx()` will round up sizes within
that range up to the next multiple of 4 MB (chunk size)).

Test Plan: Call to `folly::goodMallocSize(4161568)` no longer triggeres an assert.

Reviewed By: je@fb.com

Subscribers: aalexandre, trunkagent, njormrod, folly-diffs@

FB internal diff: D1638370

Signature: t1:1638370:1414703429:f3ed2cc8dcb183ff4e8367e2c1f884e122605cba
folly/Malloc.h