18.2.87. PMIx_Data_buffer_load

PMIx_Data_buffer_load — Load a raw byte payload into a pmix_data_buffer_t.

18.2.87.1. SYNOPSIS

#include <pmix.h>

void PMIx_Data_buffer_load(pmix_data_buffer_t *b,
                           char *bytes, size_t sz);

18.2.87.2. INPUT PARAMETERS

  • b: Pointer to the destination pmix_data_buffer_t into which the payload is to be loaded. The buffer must already have been created (e.g., with PMIx_Data_buffer_create(3)) or constructed (e.g., with PMIx_Data_buffer_construct(3)).

  • bytes: Pointer to the block of packed bytes to be transferred into the buffer.

  • sz: The number of bytes referenced by bytes.

18.2.87.3. DESCRIPTION

Transfer a block of previously packed bytes into b so that the data can subsequently be extracted with the unpack operations. The function wraps bytes and sz in a pmix_byte_object_t(5) and loads it into the buffer via PMIx_Data_load(3).

The transfer is a move, not a copy: the buffer takes direct ownership of the memory referenced by bytes — no new allocation is made and no byte-copy is performed. Because ownership has moved into the buffer, the caller must not free bytes afterward; that memory will be released when the buffer is later destructed or released (for example with PMIx_Data_buffer_destruct(3) or PMIx_Data_buffer_release(3)).

If the buffer already holds a payload, that existing payload is first freed before the new one is loaded. The caller is responsible for supplying data that is already in packed form — such as the payload previously extracted with PMIx_Data_buffer_unload(3). The load operation performs no serialization of its own.

18.2.87.4. RETURN VALUE

PMIx_Data_buffer_load returns no value (void).

18.2.87.5. NOTES

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