viMemFree/viMemFreeEx
Purpose
Frees memory previously allocated using the viMemAlloc() operation.
C Syntax
ViStatus viMemFree(ViSession vi, ViBusAddress offset)
ViStatus viMemFreeEx(ViSession vi, ViBusAddress64 offset)
Visual Basic Syntax
viMemFree&(ByVal vi&, ByVal offset&)
Resource Classes
GPIB-VXI INSTR, PXI MEMACC, VXI INSTR
Parameters
Name | Direction | Description |
---|---|---|
vi |
IN |
Unique logical identifier to a session. |
offset |
IN |
Specifies the memory previously allocated with viMemAlloc() or viMemAllocEx. For viMemFree(), this is a 32-bit value for 32-bit applications and a 64-bit value for 64-bit applications. For viMemFreeEx(), this is always a 64-bit value. |
Return Values
Completion Codes | Description |
---|---|
VI_SUCCESS |
Operation completed successfully. |
Error Codes | Description |
---|---|
VI_ERROR_INV_OBJECT |
The given session reference is invalid. |
VI_ERROR_NSUP_OPER |
The given vi does not support this operation. |
VI_ERROR_INV_OFFSET |
Invalid offset specified. |
VI_ERROR_WINDOW_MAPPED |
The specified offset is currently in use by viMapAddress(). |
Description
The viMemFree() operation frees the memory previously allocated using viMemAlloc(). The viMemFreeEx() operation frees the memory previously allocated using viMemAllocEx(). If the specified offset has been mapped using viMapAddress() or viMapAddressEx(), it must be unmapped before it can be freed.
Related Topics