table of contents
| PMIX_PDATA_CREATE(3) | OpenPMIx | PMIX_PDATA_CREATE(3) |
PMIx_Pdata_create — Allocate and initialize an array of pmix_pdata_t(5) <#man5-pmix-pdata-t> structures.
SYNOPSIS¶
#include <pmix.h> pmix_pdata_t* PMIx_Pdata_create(size_t n);
Python Syntax¶
No Python equivalent
INPUT PARAMETERS¶
- •
- n: Number of pmix_pdata_t(5) <#man5-pmix-pdata-t> structures to allocate.
DESCRIPTION¶
Allocate a contiguous array of n pmix_pdata_t <#man5-pmix-pdata-t> structures on the heap and initialize each element as if by PMIx_Pdata_construct(3) <#man3-pmix-pdata-construct> — each element is zeroed and its value type set to PMIX_UNDEF.
The returned array is owned by the caller and must be released with PMIx_Pdata_free(3) <#man3-pmix-pdata-free>, which destructs each element and frees the array storage.
RETURN VALUE¶
Returns a pointer to the newly allocated array of pmix_pdata_t <#man5-pmix-pdata-t> structures, or NULL if n is zero or the allocation fails.
NOTES¶
Because a request for zero elements returns NULL, callers should treat a NULL return as either an out-of-memory condition or a zero-length request, depending on the value passed for n.
EXAMPLES¶
Allocate and free an array:
pmix_pdata_t *array; array = PMIx_Pdata_create(4); /* ... populate and use array ... */ PMIx_Pdata_free(array, 4);
See also:
Copyright¶
2014-2026, OpenPMIx Community
| November 5, 2026 |