Commit 6e0b5856 authored by Felix Handte's avatar Felix Handte Committed by Facebook Github Bot

Expose Deleter in Context Pool

Summary: As title.

Reviewed By: yfeldblum

Differential Revision: D17937014

fbshipit-source-id: a0ff5f5f9cbbb182794dc564610d7adb9c7c8d08
parent 628af5dd
......@@ -64,17 +64,21 @@ class CompressionContextPool {
if (t == nullptr) {
throw_exception<std::bad_alloc>();
}
return Ref(t, ReturnToPoolDeleter(this, deleter_));
return Ref(t, get_deleter());
}
auto ptr = std::move(stack->back());
stack->pop_back();
return Ref(ptr.release(), ReturnToPoolDeleter(this, deleter_));
return Ref(ptr.release(), get_deleter());
}
size_t size() {
return stack_.rlock()->size();
}
ReturnToPoolDeleter get_deleter() {
return ReturnToPoolDeleter(this, deleter_);
}
private:
void add(InternalRef ptr) {
DCHECK(ptr);
......
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