1<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> 2<HTML> 3<HEAD> 4<META http-equiv="Content-Type" content="text/html; charset=windows-1252"> 5<META name="GENERATOR" content="IBM WebSphere Studio Homepage Builder Version 7.0.0.0 for Windows"> 6<META http-equiv="Content-Style-Type" content="text/css"> 7<TITLE>OS_VisitAllocated</TITLE> 8<LINK rel="stylesheet" href="../../css/nitro.css" type="text/css"> 9</HEAD> 10<BODY> 11<H1 align="left">OS_VisitAllocated <IMG src="../../image/NTR.gif" align="middle"><IMG src="../../image/TWL.gif" align="middle"></H1> 12<H2>Syntax</H2> 13<DL> 14 <DD> 15 <PRE><CODE>#include <nitro/os.h></CODE></PRE> 16 <PRE><CODE>void OS_VisitAllocated( OSArenaID id, OSAllocVisitor visitor );</CODE></PRE> 17</DL> 18<H2>Arguments</H2> 19<TABLE border="1" width="100%"> 20 <TBODY> 21 <TR> 22 <TD width="13%"><EM><STRONG>id</STRONG></EM></TD> 23 <TD width="87%">ID of the arena associated with the memory block</TD> 24 </TR> 25 <TR> 26 <TD><B><I>visitor</I></B></TD> 27 <TD>The function that is called for each memory block. See below the items below for definitions.</TD> 28 </TR> 29 </TBODY> 30</TABLE> 31<H2>Return Values</H2> 32<P>None.</P> 33<H2>Description</H2> 34<P>This function calls the user-specified function <B><I>visitor</I></B> with the target being all of the memory blocks allocated to the heaps.</P> 35<P>The arena is specified with the arena ID (<em><strong>id</strong></em>). To read more about this value, see <a href="../arena/OS_InitArena.html"><code>OS_InitArena</code></a>.</P> 36<P>The <EM><STRONG><CODE>visitor</CODE></STRONG></EM> type, <CODE>OSAllocVisitor</CODE>, is defined as follows.</P> 37<BLOCKQUOTE><TT><CODE>typedef void (*OSAllocVisitor)( void* obj, u32 size );</CODE></TT></BLOCKQUOTE> 38<P>The first argument is a pointer to the memory block; the second argument is the size of the memory block. The pointer does not point to the managing header, but to the actual data region. The size is in bytes and is the size that the memory block occupies in the heap, excluding the management header.</P> 39<H2>See Also</H2> 40<P><A href="../arena/OS_InitArena.html"><code>OS_InitArena</code></A>, <A href="OS_InitAlloc.html"><code>OS_InitAlloc</code></A>, <A href="OS_AllocFromHeap.html"><code>OS_AllocFromHeap</code></A></P> 41<H2>Revision History</H2> 42<P>2004/01/07 Initial version.</P> 43<hr><p>CONFIDENTIAL</p></body> 44</HTML>