On 10/29/2009 10:46 PM, Roland Plüss wrote:
When I get this correctly then this would be in fact gst_object_alloc(
oopClass, numberOfCOnlyBytes ); where numberOfCOnlyBytes is the number
of bytes I append to the struct which is not accessible to smalltalk. So
far so right?

Yes, right. numberOfCOnlyBytes can actually be just sizeof (void *) with the C data stored "on the side". You choose (remember that if you place data in the Smalltalk object you have to deal with the GC moving the objects).

So I assume if I want to use this approach I have to
provide a cCall for #new which creates the object using the prior
mentioned gst_object_alloc bypassing the smalltalk creation call. Sounds
like quite the hack but it looks like it could work out.

Doesn't seem to bad. Most likely you'd have a cCall for #initialize anyway. Having one for #new instead does not change much.

Paolo


_______________________________________________
help-smalltalk mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/help-smalltalk

Reply via email to