Commit f05803b2 authored by Tudor Bosman's avatar Tudor Bosman

D'oh: fix size computation in ThreadLocalDetail.h

Test Plan: thread_local_test

Reviewed By: ldemailly@fb.com

FB internal diff: D490912
parent 7a9aeea1
...@@ -271,8 +271,8 @@ struct StaticMeta { ...@@ -271,8 +271,8 @@ struct StaticMeta {
prevSize < jemallocMinInPlaceExpandable || prevSize < jemallocMinInPlaceExpandable ||
(rallocm( (rallocm(
static_cast<void**>(static_cast<void*>(&threadEntry_.elements)), static_cast<void**>(static_cast<void*>(&threadEntry_.elements)),
NULL, newSize, 0, ALLOCM_NO_MOVE | ALLOCM_ZERO) != NULL, newSize * sizeof(ElementWrapper), 0,
ALLOCM_SUCCESS)) { ALLOCM_NO_MOVE | ALLOCM_ZERO) != ALLOCM_SUCCESS)) {
// Sigh, must realloc, but we can't call realloc here, as elements is // Sigh, must realloc, but we can't call realloc here, as elements is
// still linked in meta, so another thread might access invalid memory // still linked in meta, so another thread might access invalid memory
// after realloc succeeds. We'll copy by hand and update threadEntry_ // after realloc succeeds. We'll copy by hand and update threadEntry_
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment