folly::CoreCachedWeakPtr

Core-local cache of weak pointers to a shared object.

Synopsis

Declared in <folly/concurrency/CoreCachedSharedPtr.h>

template<
    class T,
    size_t kMaxSlots = kCoreCachedSharedPtrDefaultMaxSlots>
class CoreCachedWeakPtr;

Description

Mirrors the core-local sharding of CoreCachedSharedPtr for weak references, reducing contention when observing the pointer.

Member Functions

NameDescription
CoreCachedWeakPtr [constructor]Constructors
get Returns the weak pointer cached for the current core.
lock Locks the core-local weak pointer into a shared pointer.
reset reset overloads