This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Is this a bug in libffi testsuite on solaris2.8?
- From: dewar at gnat dot com (Robert Dewar)
- To: aph at redhat dot com, dewar at gnat dot com
- Cc: gcc at gcc dot gnu dot org, lucier at math dot purdue dot edu, zack at codesourcery dot com
- Date: Sun, 2 Nov 2003 13:32:03 -0500 (EST)
- Subject: Re: Is this a bug in libffi testsuite on solaris2.8?
> On the heap -- where's the problem? This is no more likely to cause a
> memory leak than any other use of malloc().
>
> Andrew.
I don't see that, if a user uses malloc, then it is up to the user to do the
free. here we have an implicit use of malloc, and the compiler must be
very careful to make sure this is freed on all possible paths (that means
of course introducing an exception handler at the current level to make
sure it gets freed if there is an exception -- that's straightforward in
C++ and Ada, but a bit odd in C, but I think necessary, a longjmp can
leave explicitly malloc'ed stuff still allocated, but not implicitly
allocated stuff.