folly::sizedFree

Frees's memory using sdallocx if possible

Synopsis

Declared in <folly/memory/Malloc.h>

void
sizedFree(
    void* ptr,
    size_t size);

Description

The sdallocx function deallocates memory allocated by malloc or memalign. It takes a size parameter to pass the original allocation size. The default weak implementation calls free(), but TCMalloc overrides it and uses the size to improve deallocation performance.

Parameters

NameDescription
ptrPointer to the buffer to free
sizeSize to free