This is the mail archive of the
java-patches@gcc.gnu.org
mailing list for the Java project.
Re: Patch: FYI: don't call getSystemClassLoader()
- From: Bryce McKinlay <mckinlay at redhat dot com>
- To: tromey at redhat dot com
- Cc: Java Patch List <java-patches at gcc dot gnu dot org>
- Date: Thu, 10 Mar 2005 06:42:22 -0500
- Subject: Re: Patch: FYI: don't call getSystemClassLoader()
- References: <m3sm34ee42.fsf@localhost.localdomain>
Tom Tromey wrote:
I'm checking this in on the trunk and the 4.0 branch.
Andrew pointed out that calling getSystemClassLoader is expensive, as
we do a security check. I think there is no reason to call this
method from our native code; instead it is always safe to simply refer
to the field itself. Note that we don't rely on the class
initialization semantics of the method call in these places.
Good idea. Note that there's already a "getSystemClassLoaderInternal()"
in Class.h. We should probably try to standardize on one or the other
(the field or the inlined accessor method).
Bryce