table of contents
| PMIX_DATA_BUFFER_LOAD(3) | OpenPMIx | PMIX_DATA_BUFFER_LOAD(3) |
PMIx_Data_buffer_load — Load a raw byte payload into a pmix_data_buffer_t.
SYNOPSIS¶
#include <pmix.h> void PMIx_Data_buffer_load(pmix_data_buffer_t *b,
char *bytes, size_t sz);
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) <#man3-pmix-data-buffer-create>) or constructed (e.g., with PMIx_Data_buffer_construct(3) <#man3-pmix-data-buffer-construct>).
- bytes: Pointer to the block of packed bytes to be transferred into the buffer.
- sz: The number of bytes referenced by bytes.
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) <#man5-pmix-byte-object-t> and loads it into the buffer via PMIx_Data_load(3) <#man3-pmix-data-load>.
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) <#man3-pmix-data-buffer-destruct> or PMIx_Data_buffer_release(3) <#man3-pmix-data-buffer-release>).
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) <#man3-pmix-data-buffer-unload>. The load operation performs no serialization of its own.
RETURN VALUE¶
PMIx_Data_buffer_load returns no value (void).
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.
See also:
Copyright¶
2014-2026, OpenPMIx Community
| November 5, 2026 |