18.2.134. PMIx_Pdata_free

PMIx_Pdata_free — Release an array of pmix_pdata_t(5) structures allocated by PMIx_Pdata_create(3).

18.2.134.1. SYNOPSIS

#include <pmix.h>

void PMIx_Pdata_free(pmix_pdata_t *p, size_t n);

18.2.134.1.1. Python Syntax

No Python equivalent

18.2.134.2. INPUT PARAMETERS

  • p: Pointer to the array of pmix_pdata_t(5) structures to be released.

  • n: Number of structures in the array.

18.2.134.3. DESCRIPTION

Release an array of pmix_pdata_t structures that was previously allocated by PMIx_Pdata_create(3). Each of the n elements is first destructed — releasing any memory held by its value field, as PMIx_Pdata_destruct(3) would — and then the array storage itself is freed.

If p is NULL or n is zero, the function does nothing.

18.2.134.4. RETURN VALUE

PMIx_Pdata_free returns no value (void).

18.2.134.5. NOTES

Use PMIx_Pdata_free only on storage obtained from PMIx_Pdata_create(3). For a single structure provided by the caller (stack or embedded), use PMIx_Pdata_destruct(3) instead, as PMIx_Pdata_free frees the array storage the library allocated.

The function does not modify the caller’s pointer; after the call the caller should discard or reset p to avoid using freed memory.

18.2.134.6. EXAMPLES

Allocate and free an array:

pmix_pdata_t *array;

array = PMIx_Pdata_create(4);
/* ... populate and use array ... */
PMIx_Pdata_free(array, 4);
array = NULL;