mallinfo not 64-bit clean

Wolfram Gloger wmglo@dent.med.uni-muenchen.de
Wed Aug 4 09:37:00 GMT 2004


Hello,

> If somebody spells out what data is wanted and designs a reasonable
> interface which fits the current implementation and possible future
> interfaces, then we might want to look into adding support for this.
> But mallinfo() is dead.

Agreed, mallinfo() was added at a time when there was uncertainty
whether future standards would perhaps include it.  Current SUS
doesn't.

I will draft up a proposal for a more suitable, 64bit-clean interface
soon (until Sunday).  I never liked the return of the struct by value,
and would prefer something like:

struct arena_info {
       ... /* size_t fields, no int... */
};

/* Return non-0 if no such arena exists.  */
int malloc_get_arena_info(int arena_number, struct arena_info *__aptr);

BTW it now occurs to me that having such a function would also make it
_much_ easier (in fact, trivial) to separate out the malloc_stats()
function into its own file, so stdio isn't always dragged in by malloc
with static linking.  I'll start working on this ASAP.

Regards,
Wolfram.



More information about the Libc-alpha mailing list