src/backend/replication/logical/reorderbuffer.c
static void
ReorderBufferToastReset(ReorderBuffer *rb, ReorderBufferTXN *txn)
{
	HASH_SEQ_STATUS hstat;
	ReorderBufferToastEnt *ent;

	if (txn->toast_hash == NULL)
		return;

	/* sequentially walk over the hash and free everything */
	hash_seq_init(&hstat, txn->toast_hash);
	while ((ent = (ReorderBufferToastEnt *) hash_seq_search(&hstat)) != NULL)
	{
		dlist_mutable_iter it;

		if (ent->reconstructed != NULL)
			pfree(ent->reconstructed);

		dlist_foreach_modify(it, &ent->chunks)
		{
			ReorderBufferChange *change =
			dlist_container(ReorderBufferChange, node, it.cur);

			dlist_delete(&change->node);
			ReorderBufferReturnChange(rb, change);
		}
	}

	hash_destroy(txn->toast_hash);
	txn->toast_hash = NULL;
}
/*
 * Free all resources allocated for toast reconstruction.
 */
Free all resources allocated for toast reconstruction.
Free all resources allocated for toast reconstruction .
static void
ReorderBufferToastReset(ReorderBuffer *rb, ReorderBufferTXN *txn)
{
	HASH_SEQ_STATUS hstat;
	ReorderBufferToastEnt *ent;
	if (txn->toast_hash == NULL)
		return;
	hash_seq_init(&hstat, txn->toast_hash);
	while ((ent = (ReorderBufferToastEnt *) hash_seq_search(&hstat)) != NULL)
	{
		dlist_mutable_iter it;
		if (ent->reconstructed != NULL)
			pfree(ent->reconstructed);
		dlist_foreach_modify(it, &ent->chunks)
		{
			ReorderBufferChange *change =
			dlist_container(ReorderBufferChange, node, it.cur);
			dlist_delete(&change->node);
			ReorderBufferReturnChange(rb, change);
		}
	}
	hash_destroy(txn->toast_hash);
	txn->toast_hash = NULL;
}
static void ReorderBufferToastReset ( ReorderBuffer * rb , ReorderBufferTXN * txn ) { HASH_SEQ_STATUS hstat ; ReorderBufferToastEnt * ent ; if ( txn -> toast_hash == NULL ) return ; hash_seq_init ( & hstat , txn -> toast_hash ) ; while ( ( ent = ( ReorderBufferToastEnt * ) hash_seq_search ( & hstat ) ) != NULL ) { dlist_mutable_iter it ; if ( ent -> reconstructed != NULL ) pfree ( ent -> reconstructed ) ; dlist_foreach_modify ( it , & ent -> chunks ) { ReorderBufferChange * change = dlist_container ( ReorderBufferChange , node , it . cur ) ; dlist_delete ( & change -> node ) ; ReorderBufferReturnChange ( rb , change ) ; } } hash_destroy ( txn -> toast_hash ) ; txn -> toast_hash = NULL ; }
Free all resources allocated for toast reconstruction.
Free all resources allocated for toast reconstruction .
/* sequentially walk over the hash and free everything */