- Documented /N/M.
[tangerine.git] / compiler / arossupport / debugmem.c
blob2eb5887da144b84210f11219a28fa889f721051b
1 /*
2 Copyright © 1995-2007, The AROS Development Team. All rights reserved.
3 $Id$
5 Show a dump of the memory list.
6 */
8 #define DEBUG 1
9 #include <exec/lists.h>
10 #include <exec/memory.h>
11 #include <exec/execbase.h>
12 #include <aros/debug.h>
13 #include <proto/exec.h>
15 /*****************************************************************************
17 NAME */
18 #include <proto/arossupport.h>
20 void debugmem (
22 /* SYNOPSIS */
23 void)
25 /* FUNCTION
26 Print information about all memory lists.
28 INPUTS
29 None.
31 RESULT
32 None.
34 NOTES
35 This function is not part of a library and may thus be called
36 any time.
38 EXAMPLE
40 BUGS
42 SEE ALSO
44 INTERNALS
46 ******************************************************************************/
48 #ifndef __DONT_USE_DEBUGMEM__
49 struct MemHeader *mh;
50 struct MemChunk *mc;
52 Forbid();
54 for
56 mh = (struct MemHeader *) GetHead(&SysBase->MemList);
57 mh != NULL;
58 mh = (struct MemHeader *) GetSucc(mh)
61 bug("List %s: Attr=%08lX from 0x%p to 0x%p Free=%ld\n"
62 , mh->mh_Node.ln_Name
63 , mh->mh_Attributes
64 , mh->mh_Lower
65 , mh->mh_Upper
66 , mh->mh_Free
69 for (mc=mh->mh_First; mc; mc=mc->mc_Next)
71 bug (" Chunk %p Size %ld\n", mc, mc->mc_Bytes);
75 Permit();
76 #endif
77 } /* debugmem */