The five types of IBM Smalltalk objects include:
In addition, all of these object types except "immediate" can be marked as one of the following:
An immediate object's value is represented directly in the object pointer, with no data associated. In IBM Smalltalk, true, false, nil, Character, and SmallInteger are immediate. In C, true, false, and nil can be referenced as EsTrue, EsFalse, and EsNil, respectively.
IBM Smalltalk SmallIntegers range from -1073741824 to +1073741823.
Character values range from 0 to 65535.
A pointer object's instance variables or indexed slots contain references to other objects. An example of this type of object is Array.
Byte, word, and long objects have no named instance variables. The indexed slots contain bytes, word, or longs, respectively.
Pointer, byte, word, and long objects can be marked read-only. A read-only object cannot be stored into by Smalltalk.
The following methods relate to read-only objects:
If this method answers true, the store operation is retried. If the receiver has been marked read-write, the store will take place. If not, this message will be sent again. If this method answers false, the store operation is ignored.
Pointer, byte, word, and long objects can be made fixed. A fixed object cannot be moved by the Smalltalk garbage collector. Fixed objects can be used to provide C code with memory that can be used to store results (for example, a buffer for a communications interrupt handler). Once an object has been made fixed, its address does not change.
The following methods relate to fixed objects: