18.2.84. PMIx_Data_buffer_destruct

PMIx_Data_buffer_destruct — Release the payload held inside a pmix_data_buffer_t without freeing the structure itself.

18.2.84.1. SYNOPSIS

#include <pmix.h>

void PMIx_Data_buffer_destruct(pmix_data_buffer_t *b);

18.2.84.2. INPUT PARAMETERS

  • b: Pointer to the pmix_data_buffer_t whose internal storage is to be released.

18.2.84.3. DESCRIPTION

Free the data payload stored inside a pmix_data_buffer_t and reset the structure so that it is empty but still usable. If the buffer holds a payload, its internal base_ptr allocation is freed and the pointer is set to NULL. The pack_ptr and unpack_ptr pointers are cleared, and bytes_allocated and bytes_used are set to zero.

The structure memory of b itself is not freed. After destruction the buffer is left in the same empty state produced by PMIx_Data_buffer_construct(3), so it may be reused for further pack or load operations without being reconstructed.

PMIx_Data_buffer_destruct is the correct counterpart to PMIx_Data_buffer_construct(3) for buffers whose structure storage was supplied by the caller (for example, a stack-declared or embedded buffer). For a buffer allocated with PMIx_Data_buffer_create(3), use PMIx_Data_buffer_release(3) instead, which both destructs the payload and frees the structure.

18.2.84.4. RETURN VALUE

PMIx_Data_buffer_destruct returns no value (void).

18.2.84.5. NOTES

PMIx_Data_buffer_destruct is an OpenPMIx convenience routine. The Standard-defined interface for this operation is the PMIX_DATA_BUFFER_DESTRUCT macro, which is implemented as a direct call to this function.