Category: Language-C interface
Superclass: Object
I am not part of the standard Smalltalk kernel class hierarchy. I contain type information used by subclasses of CObject, which represents external C data items. My only instance variable, cObjectType, is used to hold onto the CObject subclass that gets created for a given CType. Used primarily in the C part of the interpreter because internally it cannot execute methods to get values, so it has a simple way to access instance variable which holds the desired subclass. My subclasses have instances which represent the actual data types; for the scalar types, there is only one instance created of each, but for the aggregate types, there is at least one instance per base type and/or number of elements.

Method category index

C instance creation (class)
initialization (class)
accessing (instance)
basic (instance)
C instance creation (instance)
storing (instance)

C instance creation (class)

cObjectBinding: aCObjectSubclassBinding
Create a new CType for the given subclass of CObject

cObjectType: aCObjectSubclass

Create a new CType for the given subclass of CObject

computeAggregateType: type

Private - Called by from: for pointers/arrays. Format of type: (#array #int 3) or (#ptr #{FooStruct})

from: type

Private - Pass the size, alignment, and description of CType for aBlock, given the field description in `type' (the second element of each pair).

top


initialization (class)

initialize
Initialize the receiver's TypeMap

top


accessing (instance)

alignof
Answer the size of the receiver's instances

arrayType: size

Answer a CArrayCType which represents an array with the given size of CObjects whose type is in turn represented by the receiver

cObjectType

Answer the CObject subclass whose instance is created when new is sent to the receiver

new: anInteger

Allocate a new CObject with room for anInteger C objects of the type (class) identified by the receiver. It is the caller's responsibility to free the memory allocated for it.

ptrType

Answer a CPtrCType which represents a pointer to CObjects whose type is in turn represented by the receiver

sizeof

Answer the size of the receiver's instances

valueType

valueType is used as a means to communicate to the interpreter the underlying type of the data. For anything but scalars, it's just 'self'

top


basic (instance)

= anObject
Return whether the receiver and anObject are equal.

hash

Return a hash code for the receiver.

top


C instance creation (instance)

address: cObjOrInt
Create a new CObject with the type (class) identified by the receiver, pointing to the given address (identified by an Integer or CObject).

gcNew

Allocate a new CObject with the type (class) identified by the receiver. The object is movable in memory, but on the other hand it is garbage-collected automatically.

gcNew: anInteger

Allocate a new CObject with room for anInteger C object of the type (class) identified by the receiver. The object is movable in memory, but on the other hand it is garbage-collected automatically.

new

Allocate a new CObject with the type (class) identified by the receiver. It is the caller's responsibility to free the memory allocated for it.

top


storing (instance)

storeOn: aStream
Store Smalltalk code that compiles to the receiver

top