void amqp_release_buffers(amqp_connection_state_t state) { ENFORCE_STATE(state, CONNECTION_STATE_IDLE); amqp_assert(state->first_queued_frame == NULL, "Programming error: attempt to amqp_release_buffers while waiting events enqueued"); recycle_amqp_pool(&state->frame_pool); recycle_amqp_pool(&state->decoding_pool); }
void amqp_maybe_release_buffers_on_channel(amqp_connection_state_t state, amqp_channel_t channel) { amqp_link_t *queued_link; amqp_pool_t *pool; if (CONNECTION_STATE_IDLE != state->state) { return; } queued_link = state->first_queued_frame; while (NULL != queued_link) { amqp_frame_t *frame = queued_link->data; if (channel == frame->channel) { return; } queued_link = queued_link->next; } pool = amqp_get_channel_pool(state, channel); if (pool != NULL) { recycle_amqp_pool(pool); } }
void empty_amqp_pool(amqp_pool_t *pool) { recycle_amqp_pool(pool); empty_blocklist(&pool->pages); }