Scroll to navigation

PMIX_VALUE_CREATE(3) OpenPMIx PMIX_VALUE_CREATE(3)

PMIx_Value_create — Allocate and initialize an array of pmix_value_t(5) <#man5-pmix-value-t> structures.

SYNOPSIS

#include <pmix.h>
pmix_value_t* PMIx_Value_create(size_t n);


Python Syntax

No Python equivalent

INPUT PARAMETERS

•
n: Number of pmix_value_t(5) <#man5-pmix-value-t> structures to allocate.

DESCRIPTION

Allocate a contiguous array of n pmix_value_t(5) <#man5-pmix-value-t> structures on the heap and construct each element (zeroing it and setting its type to PMIX_UNDEF), exactly as PMIx_Value_construct(3) <#man3-pmix-value-construct> does for a single value.

The returned array is owned by the caller and must be released with PMIx_Value_free(3) <#man3-pmix-value-free>, passing the same count n, which destructs the contents of each element and frees the array storage.

RETURN VALUE

Returns a pointer to the newly allocated array of pmix_value_t(5) <#man5-pmix-value-t> structures on success.

Returns NULL if n is zero or if the allocation fails.

NOTES

PMIx_Value_create is an OpenPMIx convenience routine. The corresponding macro-style interface for this operation is PMIX_VALUE_CREATE.

EXAMPLES

Create and later release an array of values:

pmix_value_t *array;
array = PMIx_Value_create(4);
if (NULL == array) {

/* handle allocation failure */ } /* ... use the array ... */ PMIx_Value_free(array, 4);


See also:

PMIx_Value_free(3) <#man3-pmix-value-free>, PMIx_Value_construct(3) <#man3-pmix-value-construct>, PMIx_Value_destruct(3) <#man3-pmix-value-destruct>, PMIx_Value_load(3) <#man3-pmix-value-load>, PMIx_Value_xfer(3) <#man3-pmix-value-xfer>, pmix_value_t(5) <#man5-pmix-value-t>


Copyright

2014-2026, OpenPMIx Community

September 27, 2026