Scroll to navigation

PMIX_REGEX2_CREATE(3) OpenPMIx PMIX_REGEX2_CREATE(3)

PMIx_Regex2_create — Allocate and initialize an array of pmix_regex2_t(5) <#man5-pmix-regex2-t> structures.

SYNOPSIS

#include <pmix.h>
pmix_regex2_t* PMIx_Regex2_create(size_t n);


Python Syntax

No Python equivalent

INPUT PARAMETERS

•
n: Number of pmix_regex2_t structures to allocate.

DESCRIPTION

Allocate a contiguous array of n pmix_regex2_t structures on the heap and construct each element (see PMIx_Regex2_construct(3) <#man3-pmix-regex2-construct>) so that every type and bytes pointer is NULL and every len is zero. A pointer to the first element of the array is returned.

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

RETURN VALUE

Returns a pointer to the newly allocated array of pmix_regex2_t structures, or NULL if n is zero or the allocation failed.

NOTES

An array obtained from PMIx_Regex2_create must be released with PMIx_Regex2_free(3) <#man3-pmix-regex2-free>, which both destructs the contents of each element and frees the array storage itself. Do not release such an array element-by-element with PMIx_Regex2_destruct(3) <#man3-pmix-regex2-destruct>, as that would leave the array storage leaked.

EXAMPLES

Create and later free an array:

pmix_regex2_t *rex;
rex = PMIx_Regex2_create(2);
/* ... use the array ... */
PMIx_Regex2_free(rex, 2);


See also:

PMIx_Regex2_free(3) <#man3-pmix-regex2-free>, PMIx_Regex2_construct(3) <#man3-pmix-regex2-construct>, PMIx_Regex2_destruct(3) <#man3-pmix-regex2-destruct>, pmix_regex2_t(5) <#man5-pmix-regex2-t>


Copyright

2014-2026, OpenPMIx Community

September 27, 2026