[cc65] debugmalloc for cc65, v1.0

From: MagerValp <MagerValp1cling.gu.se>
Date: 2004-07-16 15:40:52
Having, yet again, been bitten by a nasty (yet trivial) malloc/free
bug, I've updated my debug routines and decided to release them as
debugmalloc v1.0:

  http://www.paradroid.net/debugmalloc/

Features include:

  Auto-initialization

   * The library initializes itself when it's first called.

  Free memory display

   * The amount of free memory is displayed on the screen, together
     with the number of currently allocated chunks.

  Allocation counter

   * The number of allocations - the number of deallocations are
     displayed on the screen.

  Canaries

   * Magic bytes are inserted before and after every allocated memory
     chunk. When memory is deallocated, the library will issue a
     warning if they have been overwritten.

  Sanity checks

   * Calls like malloc(0) and free(NULL) display warnings.

  Allocation tracking

   * Allocated chunks are stored in an array, and every deallocation
     is checked against it. Deallocation of unallocated memory (such
     as an erroneous 2nd free call) displays a warning.

  Enabled on a file by file basis

   * The debug routines are only enabled in source files that #include
     them so you don't have to run the whole application with them,
     only the parts that you want to debug.

I'd love some feedback, and patches are especially welcome. I'd also
like a programming language that managed memory for me, that tracked
object usage, had good garbage collection, and decent strings so we
didn't have to deal with this crap. *sigh*

-- 
    ___          .     .  .         .       . +  .         .      o   
  _|___|_   +   .  +     .     +         .  Per Olofsson, arkadspelare
    o-o    .      .     .   o         +          MagerValp@cling.gu.se
     -       +            +    .     http://www.cling.gu.se/~cl3polof/
----------------------------------------------------------------------
To unsubscribe from the list send mail to majordomo@musoftware.de with
the string "unsubscribe cc65" in the body(!) of the mail.
Received on Fri Jul 16 15:40:55 2004

This archive was generated by hypermail 2.1.8 : 2004-07-16 15:41:04 CEST