MgErr DSMemStats(MemStatRec *msrp);
Returns various statistics about the memory in a zone.
Name | Type | Description |
---|---|---|
msrp | MemStatRec | Statistics about the zone's free memory in a MemStatRec structure. This parameter is a pointer. |
The following code defines the MemStatRec structure:
typedef struct {
int32 totFreeSize, maxFreeSize, nFreeBlocks;
int32 totAllocSize, maxAllocSize;
int32 nPointers, nUnlockedHdls, nLockedHdls;
int32 reserved [4];
}
The free memory in a zone consists of a number of blocks of contiguous memory. In the MemStatRec structure, totFreeSize is the sum of the sizes of the contiguous memory blocks. maxFreeSize is the largest of the contiguous memory blocks, as returned by XXMaxMem. nFreeBlocks is the number of the contiguous memory blocks.
Similarly, the allocated memory in a zone consists of a number of blocks of contiguous memory. In the MemStatRec structure, totAllocSize is the sum of the sizes of the contiguous memory blocks. maxAllocSize is the largest of the contiguous memory blocks.
Because there are three different varieties of allocated blocks, the numbers of blocks of each type is returned separately. nPointers (int32) is the number of pointers. nUnlockedHdls (int32) is the number of unlocked handles. nLockedHdls (int32) is the number of locked handles. Add the values of nPointers, nUnlockedHdls, and nLockedHdls together to find the total number of allocated blocks.
The four reserved fields are reserved for use by National Instruments.
MgErr, which can contain the following errors. If you receive errors from LabVIEW Manager functions, most error names correspond to LabVIEW error codes.
Value | Corresponding Error Code or Description |
---|---|
noErr | No error. |
mZoneErr | Handle or pointer not in specified zone. |
mFullErr | 2 |