Image file format ?

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Image file format ?

jamesl

Hi All,

I'm looking for information on the image file format, something that tells me the layout.
A little like this:

+--------+
! version !
+--------+
! count   !
+--------+

etc. I can glean this information from the Squeak C sources but I'm wanting some
additional information for validation. Maybe it is in the blue book but I have also read
that Squeak varies on this a little.

Also - what is a Compact Class Array section of the image file?

Rgs, James.

_______________________________________________
Pharo-project mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
Reply | Threaded
Open this post in threaded view
|

Re: Image file format ?

Stéphane Ducasse
we are interested in a Smalltalk based image writer too :)
So far we did not went far and just focus on playing with SystemDictionary

Hi All,

>
> I'm looking for information on the image file format, something that tells me the layout.
> A little like this:
>
> +--------+
> ! version !
> +--------+
> ! count   !
> +--------+
>
> etc. I can glean this information from the Squeak C sources but I'm wanting some
> additional information for validation. Maybe it is in the blue book but I have also read
> that Squeak varies on this a little.
>
> Also - what is a Compact Class Array section of the image file?

Compact classes are classes whose representation is optimized and normally you can have up to
5 bits (32) compact classes in the system. I reminder that eliot mentioned that he would like to
kill compact classes. Would be good to have a system less complex.

Stef

>
> Rgs, James.
> _______________________________________________
> Pharo-project mailing list
> [hidden email]
> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project


_______________________________________________
Pharo-project mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
Reply | Threaded
Open this post in threaded view
|

Re: Image file format ?

Mariano Martinez Peck
In reply to this post by jamesl


2010/9/1 James Ladd <[hidden email]>

Hi All,

I'm looking for information on the image file format, something that tells me the layout.
A little like this:

+--------+
! version !
+--------+
! count   !
+--------+

etc. I can glean this information from the Squeak C sources but I'm wanting some
additional information for validation. Maybe it is in the blue book but I have also read
that Squeak varies on this a little.

Also - what is a Compact Class Array section of the image file?

Each object (all but SmallInteger in Squeak i think) has its own Object Header. Each object has to know its class. Now...image those classes where you have a lot of instances, like Bitmap, ByteString, etc...(print  Smalltalk compactClassesArray for more examples)  If for each instance of them you need 32bits (4 bytes) to point to their class, you will use "a lot" of memory.

So, someone introduced something in the VM where they modified the Object Header so that you can use 5 bits for an index in a table of compact classes. So you have 32 classes that you can define as compact (see #becomeCompact), and this means that its instances will have an object header small (without a real pointer to its class). Thus....saves memory.

However, the system has to ask if it is compact or not several places in the vm, having an overhead I imagine.

IMHO, they could be removed since it is not THAT MUCH in today's computers. And the VM would be cleaner.



cheers

mariano

 

Rgs, James.

_______________________________________________
Pharo-project mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project


_______________________________________________
Pharo-project mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project