This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
Re: [PATCH] Slightly better way to __USE_MALLOC
- From: Loren James Rittle <rittle at latour dot rsch dot comm dot mot dot com>
- To: libstdc++ at gcc dot gnu dot org
- Cc: spencer at infointeractive dot com
- Date: Wed, 9 Oct 2002 18:27:17 -0500 (CDT)
- Subject: Re: [PATCH] Slightly better way to __USE_MALLOC
- Organization: Networks and Infrastructure Lab (IL02/2240), Motorola Labs
> Hi, all.. When debugging recently, I found it necessary to use a
> __USE_MALLOCed version of the library. Having followed the
> discussions about this topic a while back, I was aware that doing this
> is somewhat clumsy and (perhaps) error-prone. After I had actually
> rebuilt the library (and found my bug quite quickly with "mpatrol",
> BTW), I decided that it might be useful to have a malloc-using version
> of the library "hanging around". Since "a patch would be
> appreciated", here's one, albeit not a perfect one. [...]
Hi Brad,
A patch that rid us entirely of an ABI-affecting macro would be
perfect but you already noted that your patch wasn't perfect... ;-)
However, I am afraid that you didn't test well enough the various
cases which exist. Please try compiling your posted test case at -O2
(and of course removing the c++config check I added, and as you
propose to do with your patch). The program is linkable without an
error yet there is a mismatch between memory allocation
implementations. I will post a multi-file test case which blows up
when compiled in a mismatched manner, if it will help you fully
understand the broader issue.
The check was added due to user reports of non-detectable errors (of
course, we had to figure out what the root issue was since it wasn't
obvious at first). I really don't want to make it easy for users to
build a program with a non-detectable (at build-time) error.
All that said, please continue to work on this problem, if you can.
Don't worry about the form the patch needs to be in to commit; I can
help with all that cleanup later.
Regards,
Loren
--
Loren J. Rittle, Principal Staff Engineer, Motorola Labs (IL02/2240)
rittle@labs.mot.com, KeyID: 2048/ADCE34A5, FDC0292446937F2A240BC07D42763672