This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: malloc(0) during exception throw & catch
- To: Marc Espie <espie at quatramaran dot ens dot fr>,martin at loewis dot home dot cs dot tu-berlin dot de
- Subject: Re: malloc(0) during exception throw & catch
- From: Denis Perchine <dyp at perchine dot com>
- Date: Thu, 8 Jun 2000 01:58:54 +0700
- Cc: gcc at gcc dot gnu dot org
- References: <00052618072900.16260@dyp> <00052806131300.06045@dyp> <200006071843.UAA13290@quatramaran.ens.fr>
> >If count is zero, it will call malloc with a size of zero. This is in
> >turn called from fde_init. If you think this is a problem, please
> >submit a patch to gcc-patches@gcc.gnu.org.
>
> There is already code in libgcc (new*) that does assume malloc(0) and
> free(NULL) are bad things.
>
> I've been toying with a patch that would add t-fragments defines
> (HAVE_SANE_MALLOC and HAVE_SANE_FREE) to avoid those extra tests,
> since on many modern platforms, malloc(0) works, and free(NULL) as well.
This does not matter... Problem is that it is impossible or very hard to use
memory debuging tools when core libraries have such bugs inside.
> Would you think it a good idea to extend the patch to cover the case that's
> mentionned in this thread ?
Why not. The only thing I would like to see is that this will be turned off by default.
BTW, I've submitted a patch to gcc-patches for this problem and did not have any
reply for 2 weeks. Is this usual way of gcc team work?
--
Sincerely Yours,
Denis Perchine
----------------------------------
E-Mail: dyp@perchine.com
HomePage: http://www.perchine.com/dyp/
FidoNet: 2:5000/120.5
----------------------------------