This is the mail archive of the
java-patches@gcc.gnu.org
mailing list for the Java project.
Re: C++/Java: Don't use type size in object allocation
- From: Per Bothner <per at bothner dot com>
- To: Bryce McKinlay <mckinlay at redhat dot com>
- Cc: gcc-patches at gcc dot gnu dot org, java-patches at gcc dot gnu dot org
- Date: Thu, 15 Apr 2004 16:26:16 -0700
- Subject: Re: C++/Java: Don't use type size in object allocation
- References: <407F0F5C.5070604@redhat.com>
Bryce McKinlay wrote:
Currently, calls to the Java object allocation routines (eg
_Jv_AllocObject) pass both a class parameter and a size parameter. Hard
coding the size parameter at the call site contradicts binary
compatibility, since the size of the object being created may change at
runtime. Even without binary compatibility, passing the size parameter
is redundant because the size of the type can be trivially obtained from
class metadata.
I think the reason was so _Jv_AllocObject could also be used to allocate
arrays. As long as arrays no longer use _Jv_AllocObject, it's fine to
remove the size perhaps.
--
--Per Bothner
per@bothner.com http://per.bothner.com/