18.2.93. PMIx_Value_construct
PMIx_Value_construct — Initialize a caller-provided
pmix_value_t(5) structure.
18.2.93.1. SYNOPSIS
#include <pmix.h>
void PMIx_Value_construct(pmix_value_t *val);
18.2.93.1.1. Python Syntax
No Python equivalent
18.2.93.2. INPUT PARAMETERS
val: Pointer to the pmix_value_t(5) structure to be initialized. The storage for the structure itself must already exist — it is supplied by the caller (typically declared on the stack or embedded within another object).
18.2.93.3. DESCRIPTION
Initialize the memory of a pmix_value_t(5) that
the caller has already allocated. The function zeroes the entire structure
and sets the type field to PMIX_UNDEF. No heap memory is allocated
and no data payload is attached.
A value must be constructed (or created with PMIx_Value_create(3)) before it is passed to any load, transfer, or compare operation; using an uninitialized value produces undefined behavior.
Because PMIx_Value_construct operates on caller-provided storage, it
must be paired with PMIx_Value_destruct(3)
to release any payload the value subsequently acquires. Do not pass a
constructed (as opposed to created) value to
PMIx_Value_free(3), as that would attempt to
free storage the library did not allocate.
18.2.93.4. RETURN VALUE
PMIx_Value_construct returns no value (void).
18.2.93.5. NOTES
PMIx_Value_construct is an OpenPMIx convenience routine. The
corresponding macro-style interface for this operation is
PMIX_VALUE_CONSTRUCT.
18.2.93.6. EXAMPLES
Construct a structure:
pmix_value_t val;
PMIx_Value_construct(&val);