Добавил:
Upload Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
Using External Code in LabVIEW.pdf
Скачиваний:
90
Добавлен:
29.05.2015
Размер:
1.85 Mб
Скачать

Chapter 6 Function Descriptions

AZHUnlock

MgErr AZHUnlock(h);

Purpose

Unlocks the memory referenced by the application zone handle h so it can be moved. This means that the memory manager can move the block of memory to which the handle refers if other memory operations need space.

Parameters

Name

Type

Description

 

 

 

 

 

 

h

UHandle

Application zone handle you want to unlock.

 

 

 

Return Value

mgErr, which can contain the following errors:

NoErr

No error.

mZoneErr

Handle or pointer not in specified zone.

Using External Code in LabVIEW

6-22

www.ni.com

Chapter 6 Function Descriptions

AZMaxMem/DSMaxMem

int32 AZMaxMem(); int32 DSMaxMem();

Purpose

Returns the size of the largest block of contiguous memory available for allocation.

Return Value

int32, the size of the largest block of contiguous memory available for allocation.

© National Instruments Corporation

6-23

Using External Code in LabVIEW

Chapter 6 Function Descriptions

AZMemStats/DSMemStats

void AZMemStats(MemStatRec *msrp); void DSMemStats(MemStatRec *msrp);

Purpose

Returns various statistics about the memory in a zone.

Parameters

Name

Type

Description

 

 

 

 

 

 

msrp

MemStatRec

Statistics about the zone's free memory in a

 

 

MemStatRec structure. Refer to the Pointers

 

 

as Parameters section in Chapter 3, CINs,

 

 

for more information about using this

 

 

parameter.

 

 

 

A MemStatRec structure is defined as follows: 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 these blocks, maxFreeSize is the largest of these blocks (as returned by XXMaxMem), and nFreeBlocks is the number of these 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 these blocks and maxAllocSize is the largest of these 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, and nLockedHdls (int32) is the number of locked handles. Add these three values together to find the total number of allocated blocks.

The four reserved fields are reserved for use by National Instruments.

Using External Code in LabVIEW

6-24

www.ni.com

Chapter 6 Function Descriptions

AZNewHandle/DSNewHandle

UHandle AZNewHandle(size);

UHandle DSNewHandle(size);

Purpose

Creates a new handle to a relocatable block of memory of the specified size. The routine aligns all handles and pointers in DS to accommodate the largest possible data representations for the platform in use.

Parameters

Name

Type

Description

 

 

 

 

 

 

size

int32

Size, in bytes, of the handle you want to

 

 

create.

 

 

 

Return Value

A handle of the specified size. If an error occurs, this function returns NULL.

© National Instruments Corporation

6-25

Using External Code in LabVIEW

Соседние файлы в предмете [НЕСОРТИРОВАННОЕ]