This is the mail archive of the java-patches@gcc.gnu.org mailing list for the Java project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: C++/Java: Don't use type size in object allocation


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/


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]