18.2.169. PMIx_Regattr_create

PMIx_Regattr_create — Allocate and initialize an array of pmix_regattr_t(5) structures.

18.2.169.1. SYNOPSIS

#include <pmix.h>

pmix_regattr_t* PMIx_Regattr_create(size_t n);

18.2.169.1.1. Python Syntax

No Python equivalent

18.2.169.2. INPUT PARAMETERS

18.2.169.3. DESCRIPTION

Allocate a contiguous array of n pmix_regattr_t structures on the heap and initialize each element by calling PMIx_Regattr_construct(3) on it. The returned array is owned by the caller and must eventually be released with PMIx_Regattr_free(3) (passing the same count n).

If n is zero, no allocation is performed and NULL is returned.

18.2.169.4. RETURN VALUE

Returns a pointer to the newly allocated and initialized array of pmix_regattr_t structures, or NULL if n is zero or the allocation fails.

18.2.169.5. NOTES

The PMIX_REGATTR_CREATE convenience macro is a direct wrapper for this function; it assigns the returned pointer to its first argument.

18.2.169.6. EXAMPLES

Create, load, and free an array of registration-attribute structures:

pmix_regattr_t *attrs;

attrs = PMIx_Regattr_create(1);
PMIx_Regattr_load(&attrs[0], "PMIX_TIMEOUT",
                  PMIX_TIMEOUT, PMIX_INT,
                  "Time in seconds before the operation times out");
/* ... use attrs ... */
PMIx_Regattr_free(attrs, 1);