[Vm-dev] What are classes defined with varibleSubclass?
Mariano Martinez Peck
marianopeck at gmail.com
Wed Jun 8 15:44:40 UTC 2011
On Wed, Jun 8, 2011 at 5:35 PM, Javier Pimás <elpochodelagente at gmail.com>wrote:
> Hi, this is another simple (I hope) question:
> I have an instance of MethodDictionary, which is defined as
> Dictionary variableSubclass: #MethodDictionary
> instanceVariableNames: ''
> classVariableNames: ''
> poolDictionaries: ''
> category: 'Kernel-Methods'
> looking at the format field it says 3, which I understand is that instances
> have both fixed and indexed oops. The question is, what does that mean? or
> better why is it that way if the class only defines an array an a tally as
> instance variables?
I think its own class comments says it everything:
"I'm a special dictionary holding methods. I am just like a normal
Dictionary, except that I am implemented differently. Each Class has an
instance of MethodDictionary to hold the correspondence between selectors
(names of methods) and methods themselves.
In a normal Dictionary, the instance variable 'array' holds an array of
Associations. Since there are thousands of methods in the system, these
Associations waste space.
Each MethodDictionary is a variable object, with the list of keys (selector
Symbols) in the variable part of the instance. The variable 'array' holds
the values, which are CompiledMethods."
If not, then ask what part is still missing ;)
It is really newbie for you, but once I wrote this:
> Also, looking at the header, I see some strange things in the size field
> (being bigger than what I'd expect). What is the format of size field in
> this case?
> Javier Pimás
> Ciudad de Buenos Aires
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Vm-dev