This is the mail archive of the
java@gcc.gnu.org
mailing list for the Java project.
Re: Class.h and Class.java both define zero-arg constructor
Adam Megacz wrote:
>>At the moment it looks like either the Class.h one gets inlined or
>>the Class.java one gets called. Calling the Class.java one shouldn't
>>be a problem from C++ even though it is private, assuming it works.
>>
>
>How about the line
>
> ((_Jv_Self *)this)->vtable_ptr -= 2 * sizeof (void *);
>
>is that cruft, or will I run into problems with it missing?
>
It is definatly needed if the C++ constructor is being called. If the
Java constructor gets called, the vtable pointer might not get set like
C++ expects, so it may be neccessary to add something like
((_Jv_Self *)primclass)->vtable_ptr = the_vtable;
at the call site.
regards
Bryce.