src/backend/replication/logical/reorderbuffer.c
ReorderBufferChange *
ReorderBufferGetChange(ReorderBuffer *rb)
{
	ReorderBufferChange *change;

	/* check the slab cache */
	if (rb->nr_cached_changes)
	{
		rb->nr_cached_changes--;
		change = (ReorderBufferChange *)
			dlist_container(ReorderBufferChange, node,
							dlist_pop_head_node(&rb->cached_changes));
	}
	else
	{
		change = (ReorderBufferChange *)
			MemoryContextAlloc(rb->context, sizeof(ReorderBufferChange));
	}

	memset(change, 0, sizeof(ReorderBufferChange));
	return change;
}
/*
 * Get an unused, possibly preallocated, ReorderBufferChange.
 */
Get an unused, possibly preallocated, ReorderBufferChange.
Get an unused possibly preallocated ReorderBufferChange .
ReorderBufferChange *
ReorderBufferGetChange(ReorderBuffer *rb)
{
	ReorderBufferChange *change;
	if (rb->nr_cached_changes)
	{
		rb->nr_cached_changes--;
		change = (ReorderBufferChange *)
			dlist_container(ReorderBufferChange, node,
							dlist_pop_head_node(&rb->cached_changes));
	}
	else
	{
		change = (ReorderBufferChange *)
			MemoryContextAlloc(rb->context, sizeof(ReorderBufferChange));
	}
	memset(change, 0, sizeof(ReorderBufferChange));
	return change;
}
ReorderBufferChange * ReorderBufferGetChange ( ReorderBuffer * rb ) { ReorderBufferChange * change ; if ( rb -> nr_cached_changes ) { rb -> nr_cached_changes -- ; change = ( ReorderBufferChange * ) dlist_container ( ReorderBufferChange , node , dlist_pop_head_node ( & rb -> cached_changes ) ) ; } else { change = ( ReorderBufferChange * ) MemoryContextAlloc ( rb -> context , sizeof ( ReorderBufferChange ) ) ; } memset ( change , 0 , sizeof ( ReorderBufferChange ) ) ; return change ; }
Get an unused, possibly preallocated, ReorderBufferChange.
Get an unused possibly preallocated ReorderBufferChange .
/* check the slab cache */