MALLOC_SIZE(3) Library Functions Manual MALLOC_SIZE(3)

malloc_good_size, malloc_sizememory allocation information

#include <malloc/malloc.h>

size_t
malloc_good_size(size_t size);

size_t
malloc_size(const void *ptr);

The () function returns the size of the memory block that backs the allocation pointed to by ptr. The memory block size is always at least as large as the allocation it backs, and may be larger.

The () function rounds size up to a value that the allocator implementation can allocate without adding any padding; it then returns that rounded-up value.

malloc(3)

May 23, 2006 macOS 15.2