table of contents
| PMIX_BYTE_OBJECT_LOAD(3) | OpenPMIx | PMIX_BYTE_OBJECT_LOAD(3) |
PMIx_Byte_object_load — Load a data buffer into a pmix_byte_object_t(5) <#man5-pmix-byte-object-t> structure.
SYNOPSIS¶
#include <pmix.h> void PMIx_Byte_object_load(pmix_byte_object_t *b,
char *d, size_t sz);
Python Syntax¶
No Python equivalent
INPUT PARAMETERS¶
- b: Pointer to the pmix_byte_object_t(5) <#man5-pmix-byte-object-t> structure into which the data is to be loaded.
- d: Pointer to the data buffer to load.
- sz: Size, in bytes, of the data buffer.
DESCRIPTION¶
Load a data buffer into a pmix_byte_object_t <#man5-pmix-byte-object-t> by directly assigning the object’s bytes field to d and its size field to sz. No copy is made — the byte object simply takes ownership of the pointer d that the caller supplied.
Because ownership transfers, the caller must not free d after loading it; the memory will be released when the byte object is subsequently destructed or freed. The target structure b should be empty (freshly constructed) before loading, since any existing payload it holds is overwritten without being freed.
RETURN VALUE¶
PMIx_Byte_object_load returns no value (void).
NOTES¶
The convenience macro PMIX_BYTE_OBJECT_LOAD wraps this function and additionally resets the caller’s source pointer to NULL and the source size to zero, reflecting the transfer of ownership.
EXAMPLES¶
Load an allocated buffer into a byte object:
pmix_byte_object_t bo;
char *data;
size_t len;
PMIx_Byte_object_construct(&bo);
data = strdup("payload");
len = strlen(data) + 1;
PMIx_Byte_object_load(&bo, data, len);
/* 'bo' now owns 'data'; do not free 'data' directly */
PMIx_Byte_object_destruct(&bo);
See also:
Copyright¶
2014-2026, OpenPMIx Community
| November 5, 2026 |