src/backend/utils/mmgr/slab.c
static void *
SlabRealloc(MemoryContext context, void *pointer, Size size)
{
	SlabContext *slab = castNode(SlabContext, context);

	Assert(slab);

	/* can't do actual realloc with slab, but let's try to be gentle */
	if (size == slab->chunkSize)
		return pointer;

	elog(ERROR, "slab allocator does not support realloc()");
	return NULL;				/* keep compiler quiet */
}
/*
 * SlabRealloc
 *		Change the allocated size of a chunk.
 *
 * As Slab is designed for allocating equally-sized chunks of memory, it can't
 * do an actual chunk size change.  We try to be gentle and allow calls with
 * exactly the same size, as in that case we can simply return the same
 * chunk.  When the size differs, we throw an error.
 *
 * We could also allow requests with size < chunkSize.  That however seems
 * rather pointless - Slab is meant for chunks of constant size, and moreover
 * realloc is usually used to enlarge the chunk.
 */
SlabRealloc
Change the allocated size of a chunk.

As Slab is designed for allocating equally-sized chunks of memory, it can't
do an actual chunk size change.  We try to be gentle and allow calls with
exactly the same size, as in that case we can simply return the same
chunk.  When the size differs, we throw an error.

We could also allow requests with size < chunkSize.  That however seems
rather pointless - Slab is meant for chunks of constant size, and moreover
realloc is usually used to enlarge the chunk.
SlabRealloc Change the allocated size of a chunk . As Slab is designed for allocating equally - sized chunks of memory it can ' t do an actual chunk size change . We try to be gentle and allow calls with exactly the same size as in that case we can simply return the same chunk . When the size differs we throw an error . We could also allow requests with size < chunkSize . That however seems rather pointless - Slab is meant for chunks of constant size and moreover realloc is usually used to enlarge the chunk .
static void *
SlabRealloc(MemoryContext context, void *pointer, Size size)
{
	SlabContext *slab = castNode(SlabContext, context);
	Assert(slab);
	if (size == slab->chunkSize)
		return pointer;
	elog(ERROR, "slab allocator does not support realloc()");
	return NULL;				
}
static void * SlabRealloc ( MemoryContext context , void * pointer , Size size ) { SlabContext * slab = castNode ( SlabContext , context ) ; Assert ( slab ) ; if ( size == slab -> chunkSize ) return pointer ; elog ( ERROR , " " ) ; return NULL ; }
SlabRealloc
              Change the allocated size of a chunk.
SlabRealloc Change the allocated size of a chunk .
/* can't do actual realloc with slab, but let's try to be gentle */ /* keep compiler quiet */