avr-libc-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[avr-libc-dev] [HEAD] commit: realloc(), finally


From: Joerg Wunsch
Subject: [avr-libc-dev] [HEAD] commit: realloc(), finally
Date: Fri, 23 Jul 2004 15:09:26 +0200
User-agent: Mutt/1.4.2.1i

I've been sitting on that realloc() implementation for quite some time
now, so I decided to finally commit it.

It has not been tested very thoroughfully yet (testers are welcome!),
albeit I once ran some kind of "real-life test" on it by using it in a
lex/yacc parser.  (Actually, getting this parser to run has once been
my main motivation behind starting to implement it at all, although
I've always had it in mind to do this long since.)

I hope the explanation in the doxygen part sounds well, and gives the
innocent reader of the code a feeling about how it works.

Now that the malloc internal maintenance objects (like freelist and
brkval) went global anyway, I also consider adding some kind of
`malloc stats' function.  A feature like this has been requested
occasionally.  I'd take care to not penalize those who don't want the
feature, e. g. I wouldn't start counting the active memory chunks
since this will impose both a run-time penalty and increased memory
footprint regardless of whether you're interested in the feature or
not.  However, some of the data could easily be collected on-demand,
like the total memory allocation (brkval - __malloc_heap_start), or
freelist statistics (# chunks on freelist, total unallocated memory)
which can be gathered by walking this list.

Proposals for an API to accomplish this are welcome.

-- 
J"org Wunsch                                           Unix support engineer
address@hidden        http://www.interface-systems.de/~j/

Attachment: malloc.diff
Description: Text document


reply via email to

[Prev in Thread] Current Thread [Next in Thread]