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: martin at loewis dot home dot cs dot tu-berlin dot de
- Subject: Re: malloc(0) during exception throw & catch
- From: Marc Espie <espie at quatramaran dot ens dot fr>
- Date: Wed, 7 Jun 2000 20:43:19 +0200
- Cc: gcc at gcc dot gnu dot org
- Organization: Ecole Normale Superieure (quatramaran)
- References: <00052618072900.16260@dyp> <200005272203.AAA18359@loewis.home.cs.tu-berlin.de> <00052806131300.06045@dyp>
In article <200005281058.MAA05095@loewis.home.cs.tu-berlin.de> you write:
>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.
Would you think it a good idea to extend the patch to cover the case that's
mentionned in this thread ?