home *** CD-ROM | disk | FTP | other *** search
/ Aminet 18 / aminetcdnumber181997.iso / Aminet / misc / emu / AROSdev.lha / AROS / compiler / aros / debugmem.c < prev    next >
Encoding:
C/C++ Source or Header  |  1997-01-27  |  1.3 KB  |  76 lines

  1. /*
  2.     (C) 1995-96 AROS - The Amiga Replacement OS
  3.     $Id: debugmem.c,v 1.4 1997/01/27 00:17:40 ldp Exp $
  4.  
  5.     Desc: Show a dump of the memory list
  6.     Lang: english
  7. */
  8. #define DEBUG 1
  9. #define AROS_ALMOST_COMPATIBLE
  10. #include <exec/lists.h>
  11. #include <exec/memory.h>
  12. #include <exec/execbase.h>
  13. #include <aros/debug.h>
  14. #include <proto/exec.h>
  15.  
  16. /*****************************************************************************
  17.  
  18.     NAME */
  19. #include <proto/aros.h>
  20.  
  21.     void debugmem (
  22.  
  23. /*  SYNOPSIS */
  24.     void)
  25.  
  26. /*  FUNCTION
  27.     Print information about all memory lists.
  28.  
  29.     INPUTS
  30.     None.
  31.  
  32.     RESULT
  33.     None.
  34.  
  35.     NOTES
  36.     This function is not part of a library and may thus be called
  37.     any time.
  38.  
  39.     EXAMPLE
  40.  
  41.     BUGS
  42.  
  43.     SEE ALSO
  44.  
  45.     INTERNALS
  46.  
  47.     HISTORY
  48.     24-12-95    digulla created
  49.  
  50. ******************************************************************************/
  51. {
  52.     struct MemHeader *mh;
  53.     struct MemChunk  *mc;
  54.  
  55.     Forbid();
  56.  
  57.     for (mh=GetHead(&SysBase->MemList); mh; mh=GetSucc(mh))
  58.     {
  59.     bug("List %s: Attr=%08lX from 0x%p to 0x%p Free=%ld\n"
  60.         , mh->mh_Node.ln_Name
  61.         , mh->mh_Attributes
  62.         , mh->mh_Lower
  63.         , mh->mh_Upper
  64.         , mh->mh_Free
  65.     );
  66.  
  67.     for (mc=mh->mh_First; mc; mc=mc->mc_Next)
  68.     {
  69.         bug ("   Chunk %p Size %ld\n", mc, mc->mc_Bytes);
  70.     }
  71.     }
  72.  
  73.     Permit();
  74. } /* debugmem */
  75.  
  76.