|
proxygen
|
#include <GuardPageAllocator.h>
Public Member Functions | |
| GuardPageAllocator (bool useGuardPages) | |
| ~GuardPageAllocator () | |
| unsigned char * | allocate (size_t size) |
| void | deallocate (unsigned char *limit, size_t size) |
Private Attributes | |
| std::unique_ptr< StackCacheEntry > | stackCache_ |
| std::allocator< unsigned char > | fallbackAllocator_ |
| bool | useGuardPages_ {true} |
Stack allocator that protects an extra memory page after the end of the stack. Will only add extra memory pages up to a certain number of allocations to avoid creating too many memory maps for the process.
Definition at line 31 of file GuardPageAllocator.h.
|
explicit |
| useGuardPages | if true, protect limited amount of stacks with guard pages, otherwise acts as std::allocator. |
Definition at line 293 of file GuardPageAllocator.cpp.
References ~GuardPageAllocator().
|
default |
Referenced by GuardPageAllocator().
| unsigned char * folly::fibers::GuardPageAllocator::allocate | ( | size_t | size | ) |
Definition at line 302 of file GuardPageAllocator.cpp.
References fallbackAllocator_, folly::fibers::CacheManager::getStackCache(), folly::fibers::CacheManager::instance(), stackCache_, and useGuardPages_.
| void folly::fibers::GuardPageAllocator::deallocate | ( | unsigned char * | limit, |
| size_t | size | ||
| ) |
Deallocates the previous result of an `allocate(size)' call.
Definition at line 316 of file GuardPageAllocator.cpp.
References fallbackAllocator_, and stackCache_.
Referenced by folly::fibers::Fiber::~Fiber().
|
private |
Definition at line 52 of file GuardPageAllocator.h.
Referenced by allocate(), and deallocate().
|
private |
Definition at line 51 of file GuardPageAllocator.h.
Referenced by allocate(), and deallocate().
|
private |
Definition at line 53 of file GuardPageAllocator.h.
Referenced by allocate().