table of contents
- unstable 7.0.0~rc1-1
| PMIX_RESOURCE_UNIT_FREE(3) | OpenPMIx | PMIX_RESOURCE_UNIT_FREE(3) |
PMIx_Resource_unit_free — Release an array of pmix_resource_unit_t(5) <#man5-pmix-resource-unit-t> structures allocated by PMIx_Resource_unit_create(3) <#man3-pmix-resource-unit-create>.
SYNOPSIS¶
#include <pmix.h> void PMIx_Resource_unit_free(pmix_resource_unit_t *d, size_t n);
Python Syntax¶
No Python equivalent
INPUT PARAMETERS¶
- d: Pointer to the array of pmix_resource_unit_t(5) <#man5-pmix-resource-unit-t> structures to be released.
- n: Number of structures in the array.
DESCRIPTION¶
Release an array of pmix_resource_unit_t <#man5-pmix-resource-unit-t> structures that was previously allocated by PMIx_Resource_unit_create(3) <#man3-pmix-resource-unit-create>. Each of the n elements is first destructed as PMIx_Resource_unit_destruct(3) <#man3-pmix-resource-unit-destruct> would, and then the array storage itself is freed.
If d is NULL, the function does nothing.
RETURN VALUE¶
PMIx_Resource_unit_free returns no value (void).
NOTES¶
Use PMIx_Resource_unit_free only on storage obtained from PMIx_Resource_unit_create(3) <#man3-pmix-resource-unit-create>. For a single structure provided by the caller (stack or embedded), use PMIx_Resource_unit_destruct(3) <#man3-pmix-resource-unit-destruct> instead, as PMIx_Resource_unit_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 d to avoid using freed memory.
EXAMPLES¶
Allocate and free an array:
pmix_resource_unit_t *array; array = PMIx_Resource_unit_create(2); /* ... populate and use array ... */ PMIx_Resource_unit_free(array, 2); array = NULL;
See also:
Copyright¶
2014-2026, OpenPMIx Community
| September 27, 2026 |