Date: Thu, 20 Aug 1998 21:57:42 +0000 (GMT) From: Terry Lambert <tlambert@primenet.com> To: imp@village.org (Warner Losh) Cc: hackers@FreeBSD.ORG Subject: Re: Realloc fix for review Message-ID: <199808202157.OAA27564@usr04.primenet.com> In-Reply-To: <199808201619.KAA20970@harmony.village.org> from "Warner Losh" at Aug 20, 98 10:19:42 am
next in thread | previous in thread | raw e-mail | index | archive | help
> So rather than hack some really complicated a and na's, I write a new > function, added it to libc and then modified all of src/lib to use > this new function. I called it frealloc (freeing realloc). I added > it to the man page, etc. I know that this isn't in ANSI C nor in > POSIX, but after seeing how hard it was to get people to use strncpy > right, I thought it would be good to add this to libc. > > I did a full make world, and this seems to work. One gotcha that I > had was that I could not place frealloc into the "logical" place of > malloc.c due to the "emacs malloc" problem that was worked around in > ld.so. It was far easier to place it in its own file than to generate > a working patch for ld.so. It also seems cleaner this way as well > since the code will work with any implementation of > malloc/free/realloc. > > Comments? 1) It should be an inline function in stdlib.h, I think... 2) I suppose you did this so we can easily do a: find /usr/src -name \*.c -print | xargs grep frealloc to find all the code written by people bad at pointer math and thus in need of a pointer code review? 8-). Terry Lambert terry@lambert.org --- Any opinions in this posting are my own and not those of my present or previous employers. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199808202157.OAA27564>