[Vm-dev] Simple question about objects, headers and sizes

Javier Pimás elpochodelagente at gmail.com
Mon Jun 6 04:09:58 UTC 2011


Hi, I'm investigating the format of objects in memory. After some time I got
this conclusions/questions I'd like to know more about:

- Oops must be at least 16 bits aligned, because of SmallIntegers tagging,
is that right?
- Raw object sizes are 32 bits aligned, because of size field in header
which is in 32 bits words. So that for byte indexed instances there may be
at most 3 wasted bytes (format field in that case tell the amount not used
of the last 4 bytes). Is that the way that the VM assures the alignment of
the oops?
- And the last one and the most puzzling for me: how does objectAfter: anOop
work? I mean, for what I see, it returns the addition of anOop and the size
of the object pointed by anOop, but how can it be sure that that is the base
header and not the size or class field of the extended header?

Thanks!
          Javier.

-- 
Javier Pimás
Ciudad de Buenos Aires
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.squeakfoundation.org/pipermail/vm-dev/attachments/20110606/d2e48eb4/attachment.htm


More information about the Vm-dev mailing list