Function: reserve_mem_address
C Prototype |
aclError aclrtReserveMemAddress(void **virPtr, size_t size, size_t alignment, void *expectPtr, uint64_t flags) |
|---|---|
Python Function |
vir_ptr, ret = acl.rt.reserve_mem_address(size, alignment, expect_ptr, flags) |
Function Usage |
Reserves virtual memory. This API needs to work with other APIs to allocate virtual memory with consecutive addresses and maximize the use of physical memory.
|
Input Description |
size: int, size of the virtual address space (in byte) Must not be 0. alignment: int, alignment value of the virtual address. This parameter is reserved and can only be set to 0. expect_ptr: specifies the start address of the virtual address space to be returned. This parameter is reserved and can only be set to 0. flags: huge page or common page flag. The flag must be the same as the memory type of acl.rt.malloc_physical. Value options:
|
Return Value |
vir_ptr: int, pointing to the address of the allocated virtual address space. ret: int, error code.
|
Restrictions |
This API is not supported in Ascend RC form. |