Re: [cc65] debugmalloc for cc65, v1.0

From: MagerValp <MagerValp1cling.gu.se>
Date: 2004-07-21 13:36:00
>>>>> "UvB" == Ullrich von Bassewitz <uz@musoftware.de> writes:

UvB> Having a look at the code, I have one comment: The size of a
UvB> memory block is already stored in the word below the block. This
UvB> is undocumented, but I can make a

UvB>         size_t _heapblocksize (const void* ptr);

UvB> function available that returns this word. This would save two
UvB> bytes per allocated block, which is not much, but better than
UvB> nothing. And the function may help with other problems, too.

OK, I updated the source accordingly.

UvB> The inherent block limit (MAXCHUNKS) may be removed by using a
UvB> single linked list of blocks instead of an array.

But that would require memory allocation, and I thought that that
might not be such a good idea in a program that's suspected of mucking
up memory :) The array is fairly small anyway.

UvB> And, making ptr a register variable will probably speed up the
UvB> code and make it smaller.

OK.

Thanks!

-- 
    ___          .     .  .         .       . +  .         .      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 Wed Jul 21 13:36:04 2004

This archive was generated by hypermail 2.1.8 : 2004-07-21 13:36:13 CEST