18.2.86. PMIx_Data_buffer_release

PMIx_Data_buffer_release — Release the payload and free a heap-allocated pmix_data_buffer_t.

18.2.86.1. SYNOPSIS

#include <pmix.h>

void PMIx_Data_buffer_release(pmix_data_buffer_t *b);

18.2.86.2. INPUT PARAMETERS

  • b: Pointer to the pmix_data_buffer_t to be released. May be NULL, in which case the function does nothing.

18.2.86.3. DESCRIPTION

Fully dispose of a pmix_data_buffer_t that was allocated with PMIx_Data_buffer_create(3). The function first destructs the buffer — freeing any data payload held in its internal base_ptr allocation, exactly as PMIx_Data_buffer_destruct(3) does — and then frees the structure memory itself.

This is the difference between destruct and release: destruct frees only the buffer’s payload and leaves the structure intact for reuse, whereas release frees the payload and the structure. Consequently, PMIx_Data_buffer_release must only be used on buffers whose structure memory was allocated by the library (that is, obtained from PMIx_Data_buffer_create). Do not call it on a caller-provided buffer that was initialized with PMIx_Data_buffer_construct(3); use PMIx_Data_buffer_destruct for those.

After the call the pointer b is no longer valid and must not be dereferenced. The caller should discard its copy of the pointer.

18.2.86.4. RETURN VALUE

PMIx_Data_buffer_release returns no value (void).

18.2.86.5. NOTES

PMIx_Data_buffer_release is an OpenPMIx convenience routine. The Standard-defined interface for this operation is the PMIX_DATA_BUFFER_RELEASE macro, which calls this function and then sets the caller’s pointer to NULL.