Function: release_mem_address
Applicability
Product |
Supported (√/x) |
|---|---|
√ |
|
√ |
|
√ |
|
√ |
|
√ |
Function Usage
Frees the virtual memory allocated by the acl.rt.reserve_mem_address call.
This API needs to work with other APIs to allocate virtual memory with consecutive addresses and maximize the use of physical memory.
- Call acl.rt.reserve_mem_address to allocate virtual memory.
- Call acl.rt.malloc_physical to allocate physical memory.
- Call acl.rt.map_mem to map the virtual memory to the physical memory.
- Call specific task APIs to execute tasks.
- Call acl.rt.unmap_mem to unmap the virtual memory from the physical memory.
- Call acl.rt.free_physical to free the physical memory.
- Call acl.rt.release_mem_address to free the virtual memory.
Prototype
- C Prototype
1aclError aclrtReleaseMemAddress(void *virPtr)
- Python Function
1ret = acl.rt.release_mem_address(vir_ptr)
Parameter Description
Parameter |
Description |
|---|---|
virPtr |
Int, pointing to the address of the virtual address space to be freed. |
Return Value Description
Return Value |
Description |
|---|---|
ret |
Int, error code: 0 on success; else, failure. |
Restrictions
This API is not supported in the Ascend RC form.
If the virtual memory is mapped to physical memory, you need to unmap them by calling acl.rt.unmap_mem before freeing the virtual memory.
Parent topic: Memory Management