return (end - firstNonMagic) * sizeof(uint64_t);
}
-} // anonymous namespace
+} // namespace
void Fiber::resume() {
DCHECK_EQ(state_, AWAITING);
Fiber::~Fiber() {
#ifdef FOLLY_SANITIZE_ADDRESS
+ if (asanFakeStack_ != nullptr) {
+ fiberManager_.freeFakeStack(asanFakeStack_);
+ }
fiberManager_.unpoisonFiberStack(this);
#endif
fiberManager_.stackAllocator_.deallocate(fiberStackLimit_, fiberStackSize_);
}
}
+Fiber::LocalData::~LocalData() {
+ reset();
+}
+
Fiber::LocalData::LocalData(const LocalData& other) : data_(nullptr) {
*this = other;
}
void Fiber::LocalData::freeHeapBuffer(void* buffer) {
delete[] reinterpret_cast<char*>(buffer);
}
-}
-}
+} // namespace fibers
+} // namespace folly