Date: Tue, 21 Feb 2006 19:49:48 +0100 (CET) From: <pfgshield-freebsd@yahoo.com> To: freebsd-standards@FreeBSD.org Subject: malloc.h is still legitimate after all Message-ID: <20060221184948.9554.qmail@web32906.mail.mud.yahoo.com>
next in thread | raw e-mail | index | archive | help
Hi; I was porting some parts of COIN-OR (some Operations Research packages opensourced by IBM a while ago), and when I was happily suggesting that all occurences of malloc.h should be removed and/or replaced with stdlib.h I got this reply: ______________ Pedro, The mallinfo struct that ReportMemory uses is defined in malloc.h, and not brought in by stdlib.h. I'm testing on AIXv5.1, __STDC__ is defined, and "struct mallinfo" is unknown if I don't include malloc.h. I don't know enough about the different flavors of UNIX (System V, POSIX, BSD?) to know what to do that satisfies all. The AIX docs say "The mallopt and mallinfo subroutines are provided for source-level compatibility with the System V malloc subroutine " The gnu gcc docs say "This function and its associated data type are declared in `malloc.h'; they are an extension of the standard SVID/XPG version." ... ___________ So malloc.h will no be removed from the package but rather it will be undef'd __FreeBSD__ and the package will still work on FreeBSD. I doubt we will ever add these extensions, but there's also a glibc port for FreeBSD now so maybe __FreeBSD__ is not the correct variable here. I personally think the FreeBSD port's people have contributed greatly to clean inappropiate uses of malloc.h in the software world, but perhaps an error is too drastic and we should fall back to a warning. cheers, Pedro. --- Pedro F. Giffuni M. Sc. Industrial Eng. University of Pittsburgh Mech. Eng. Universidad Nacional de Colombia --- Yahoo is powered by FreeBSD http://www.FreeBSD.org/ ___________________________________ Yahoo! Mail: gratis 1GB per i messaggi e allegati da 10MB http://mail.yahoo.it
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20060221184948.9554.qmail>