Add a guard page to a limited number of stacks
authorAnton Likhtarov <alikhtarov@fb.com>
Thu, 4 Jun 2015 23:38:15 +0000 (16:38 -0700)
committerSara Golemon <sgolemon@fb.com>
Tue, 9 Jun 2015 20:21:36 +0000 (13:21 -0700)
commit2aa61de13bf450f17917e88e38457ea3a3079762
treef57eb48c1e4909d660cc10de4f939416e4e563a3
parentdb57efd05b6605784e1a8ed88bb20609352fe927
Add a guard page to a limited number of stacks

Summary:
GuardedPageAllocator now maintains a process-wide cache
of preallocated stacks with guard pages.  We can't create too many of these, since
each stack has the overhead of two memory mappings.  Once we run out of preallocated stacks
we simply fallback on the default allocator.

Test Plan:
unit tests

perflab
TAO unit tests

Reviewed By: pavlo@fb.com

Subscribers: zhuohuang, trunkagent, sameen, folly-diffs@, yfeldblum, chalfant

FB internal diff: D2129510

Tasks: 7319041

Signature: t1:2129510:1433542031:324942af3c9813344c1b331ee2c9b66c4bfa3f03
folly/Makefile.am
folly/experimental/fibers/FiberManager.h
folly/experimental/fibers/GuardPageAllocator-inl.h [deleted file]
folly/experimental/fibers/GuardPageAllocator.cpp [new file with mode: 0644]
folly/experimental/fibers/GuardPageAllocator.h