This is the mail archive of the
java@gcc.gnu.org
mailing list for the Java project.
Re: libjava test suite keeps getting stuck
- To: Jeff Sturm <jsturm at one-point dot com>
- Subject: Re: libjava test suite keeps getting stuck
- From: Bryce McKinlay <bryce at waitaki dot otago dot ac dot nz>
- Date: Sat, 21 Apr 2001 11:28:28 +1200
- CC: Joe Buck <jbuck at racerx dot synopsys dot com>, Zack Weinberg <zackw at stanford dot edu>, gcc at gcc dot gnu dot org, java at gcc dot gnu dot org
- References: <Pine.LNX.4.10.10104201825460.27376-100000@one-point.bright.net>
Jeff Sturm wrote:
> On Fri, 20 Apr 2001, Joe Buck wrote:
> >
> > > It turns out there is very little C++ usage of new/delete in libjava.
> > > It is trivial to replace these with malloc/free (patch below).
> >
> > This patch changes the behavior. new throws an exception on allocation
> > failure; malloc returns a null pointer. Of course, you could fix your
> > patch to throw the exception, or handle the error in some other way.
Jeff, you should use _Jv_Malloc() which which will throw a
NullPointerException on failure.
> Right, thanks. (I don't know which is worse in this case: ignoring NULL
> or not handling the exception. Either would probably be disastrous.)
>
> I'm not completely convinced these shouldn't be using GC anyway.
Yep.
regards
[ bryce ]