mstxMemRegionsUnregister

Function Description

Deregisters secondary allocation of a memory pool.

Function Prototype

void mstxMemRegionsUnregister(mstxDomainHandle_t domain, mstxMemRegionsUnregisterBatch_t const *desc)

Parameters

Table 1 Parameters

Parameter

Input/Output

Description

domain

Input

globalDomain or the handle returned by mstxDomainCreateA.

Data type: const char *

desc

Input

The input description must be the input description of mstxMemHeapRegister. Otherwise, the tool displays an error message.

typedef enum mstxMemRegionRefType {
    // Use pointers to describe memory references.
    MSTX_MEM_REGION_REF_TYPE_POINTER = 0,
    // Use handles to describe memory references.
    MSTX_MEM_REGION_REF_TYPE_HANDLE
} mstxMemRegionRefType;

typedef struct mstxMemRegionRef_t {
    mstxMemRegionRefType refType; // Memory reference description type
    union {
        void const* pointer;  // If the current memory reference is described by a pointer, the pointer to the memory area is saved here.
        mstxMemRegionHandle_t handle;  // If the memory reference is described by a handle, the handle to the memory area is saved here.
    };
} mstxMemRegionRef_t;

typedef struct mstxMemRegionsUnregisterBatch_t {
    size_t refCount;  // Number of memory references
    mstxMemRegionRef_t const *refArray;  // Memory region reference to be deregistered
} mstxMemRegionsUnregisterBatch_t;

Returns

None

Calling Example

mstxMemRegionsUnregisterBatch_t refsDesc = {}
refsDesc.refCount = 1;
refsDesc.refArray = regionRef;
mstxMemRegionsUnregister(globalDomain, &refsDesc);                   // Deregister the secondary allocation.