folly::memory::IOBufSingletonAllocator

Requirements for a singleton allocator usable with an IOBuf arena factory.

Synopsis

Declared in <folly/memory/IOBufArenaFactory.h>

template<typename T>
concept IOBufSingletonAllocator = requires(size_t sz) {
  { T::initialized() } -> std::convertible_to<bool>;
  { T::allocate(sz) } -> std::same_as<void*>;
};

Description

A conforming type exposes a static initialized() query convertible to bool and a static allocate(size_t) returning a raw void* buffer.