On Tue, Sep 22, 2009 at 04:47:56PM -0700, John M McIntosh wrote: > > On 2009-09-22, at 4:16 PM, Ken Treis wrote: > > > Eliot, Johan, Fernando, et. al.: > > > > On Sep 16, 2009, at 3:09 PM, Eliot Miranda wrote: > > > >> Hi Ken, > >> > >> On Wed, Sep 16, 2009 at 12:17 PM, Ken Treis <[email protected]> > >> wrote: > >> Perhaps there would need to be new primitives for the basic size of > >> each relevant C type? I'm anxious to hear what Eliot might have to > >> say about this since he's got about 2000x more experience with this > >> than I do. > > I'll note the most modern squeak VM's return wordSize, this might be > helpful somewhere. > > wordSize > "Answer the size (in bytes) of an object pointer." > "Smalltalk wordSize" > > ^[SmalltalkImage current vmParameterAt: 40] on: Error do: [4]
Actually, this is just the size of an object "pointer" in the object memory (i.e. BytesPerWord in ObjectMemory), which is independent of the size of a C pointer. So you would need new primitives to get at the underlying machine data types. The implementations are trivial if you are writing a plugin anyway, for example see #primitiveSizeOfPointer and #primitiveSizeOfInt in OSProcessPlugin. The "pointer" terminology referring to words the object memory is needlessly confusing, I guess we should clean that up one of these days. Dave _______________________________________________ Pharo-project mailing list [email protected] http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
