RAD Studio
ContentsIndex
PreviousUpNext
heapwalk

Header File 

alloc.h  

Category 

Memory Routines 

Prototype 

int heapwalk(struct heapinfo *hi); 

Description 

heapwalk is used to “walk” through the heap, node by node. 

heapwalk assumes the heap is correct. Use heapcheck to verify the heap before using heapwalk. _HEAPOK is returned with the last block on the heap. _HEAPEND will be returned on the next call to heapwalk. 

heapwalk receives a pointer to a structure of type heapinfo (declared in alloc.h). For the first call to heapwalk, set the hi.ptr field to null. heapwalk returns with hi.ptr containing the address of the first block. hi.size holds the size of the block in bytes. hi.in_use is a flag that’s set if the block is currently in use. 

Return Value 

One of the following values:

_HEAPEMPTY 
No heap exists 
_HEAPEND 
The end of the heap has been reached 
_HEAPOK 
The heapinfo block contains valid information about the next heap block 

Example

Portability
<table htmltable<tr><th>POSIX</th><th>Win32</th><th>ANSI C</th><th>ANSI C++</th></tr><tr><td> </td><td>+</td><td> </td><td> </td></tr></table
Copyright(C) 2009 Embarcadero Technologies, Inc. All Rights Reserved.
What do you think about this topic? Send feedback!