Commit 5076d050 authored by Dylan Yudaken's avatar Dylan Yudaken Committed by Facebook GitHub Bot

pre-allocate freeList

Summary: We know ahead of time the size of this list, so may as well pre-allocate space for it

Reviewed By: yfeldblum

Differential Revision: D22838412

fbshipit-source-id: 7d70495fe0910e65dfea49fe7baf675308ab9331
parent e0bd7f09
......@@ -74,6 +74,7 @@ class StackCache {
storage_ = reinterpret_cast<unsigned char*>(p);
/* Protect the bottommost page of every stack allocation */
freeList_.reserve(kNumGuarded);
for (size_t i = 0; i < kNumGuarded; ++i) {
auto allocBegin = storage_ + allocSize_ * i;
freeList_.emplace_back(allocBegin, /* protected= */ false);
......
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