folly::PackedSyncPtr::init

Initializes a default-constructed instance before first use.

Synopsis

Declared in <folly/PackedSyncPtr.h>

void
init(
    T* initialPtr = nullptr,
    uint16_t initialExtra = 0);

Description

A constructor is intentionally avoided so the class can be placed in packed structures, so this must be called before any other member.

Parameters

NameDescription
initialPtrThe initial raw pointer to store.
initialExtraThe initial 15-bit extra value to store.