Object allocation
These functions enable users to allocate new objects from within a user primitive.
EsObject EsAllocateObject(EsVMContext vmContext, EsBehavior allocateClass, U_32 size, U_32 saves, EsObject ** saveList)
Returns a new, initialized object of class allocateClass with size indexable instance variables. Pass 0 for saves and NULL for saveList. The instance variables of pointer objects are initialized to nil. All other objects are initialized to 0.
Error cases: If the object could not be allocated for any reason, returns NULL.
Smalltalk equivalent: allocateClass new: size
Side effects: This operation can cause a garbage collection.
EsObject EsAllocateArray(EsVMContext vmContext, U_32 size)
Returns a new, initialized Array object with size indexable instance variables. This is a convenience macro wrapping EsAllocateObject.
EsObject EsAllocateByteArray(EsVMContext vmContext, U_32 size)
Returns a new, initialized ByteArray object with size indexable instance variables. This is a convenience macro wrapping EsAllocateObject.
EsObject EsAllocateDBString(EsVMContext vmContext, U_32 size)
Returns a new, initialized DbString object with size indexable instance variables. This is a convenience macro wrapping EsAllocateObject.
EsObject EsAllocateString(EsVMContext vmContext, U_32 size)
Returns a new, initialized String object with size indexable instance variables. This is a convenience macro wrapping EsAllocateObject.
EsObject EsAllocateFixedObject(EsVMContext vmContext, EsBehavior allocateClass, U_32 size, U_32 saves, EsObject ** saveList)
Same as EsAllocateObject, except the object is allocated in fixed space. This means that the object does not move during a garbage collect.
Error cases: If the object could not be allocated for any reason, returns NULL.
Smalltalk equivalent: (allocateClass new: size) makeFixed
Last modified date: 01/29/2015