proxygen
|
Public Member Functions | |
StackCache (size_t stackSize) | |
unsigned char * | borrow (size_t size) |
bool | giveBack (unsigned char *limit, size_t size) |
~StackCache () | |
Static Public Member Functions | |
static bool | isProtected (intptr_t addr) |
Static Private Member Functions | |
static size_t | pagesize () |
static size_t | allocSize (size_t size) |
static folly::Synchronized< std::unordered_set< intptr_t > > & | protectedPages () |
Private Attributes | |
folly::SpinLock | lock_ |
unsigned char * | storage_ {nullptr} |
size_t | allocSize_ {0} |
std::vector< std::pair< unsigned char *, bool > > | freeList_ |
A cache for kNumGuarded stacks of a given size
Thread safe.
Definition at line 60 of file GuardPageAllocator.cpp.
|
inlineexplicit |
Definition at line 62 of file GuardPageAllocator.cpp.
References allocSize_, freeList_, i, folly::fibers::kNumGuarded, and storage_.
|
inline |
Definition at line 132 of file GuardPageAllocator.cpp.
References allocSize_, freeList_, protectedPages(), and storage_.
|
inlinestaticprivate |
Definition at line 171 of file GuardPageAllocator.cpp.
References pagesize().
Referenced by borrow(), and giveBack().
|
inline |
Definition at line 80 of file GuardPageAllocator.cpp.
References allocSize(), allocSize_, folly::gen::as(), freeList_, lock_, pagesize(), protectedPages(), folly::size(), and storage_.
|
inline |
Definition at line 113 of file GuardPageAllocator.cpp.
References allocSize(), allocSize_, folly::gen::as(), freeList_, folly::fibers::kNumGuarded, lock_, and storage_.
|
inlinestatic |
Definition at line 142 of file GuardPageAllocator.cpp.
References pagesize(), and protectedPages().
Referenced by protectedPages().
|
inlinestaticprivate |
Definition at line 165 of file GuardPageAllocator.cpp.
Referenced by allocSize(), borrow(), and isProtected().
|
inlinestaticprivate |
Definition at line 175 of file GuardPageAllocator.cpp.
References folly::call_once(), deadlock::info(), and isProtected().
Referenced by borrow(), isProtected(), and ~StackCache().
|
private |
Definition at line 158 of file GuardPageAllocator.cpp.
Referenced by borrow(), giveBack(), StackCache(), and ~StackCache().
|
private |
LIFO free list. Each pair contains stack pointer and protected flag.
Definition at line 163 of file GuardPageAllocator.cpp.
Referenced by borrow(), giveBack(), StackCache(), and ~StackCache().
|
private |
Definition at line 156 of file GuardPageAllocator.cpp.
Referenced by borrow(), folly::fibers::CacheManager::getStackCache(), and giveBack().
|
private |
Definition at line 157 of file GuardPageAllocator.cpp.
Referenced by borrow(), giveBack(), StackCache(), and ~StackCache().