This function allocates pages in the database to hold vector elements.
MCO_RET classname_fieldname_alloc( /*IN*/ classname *handle,
/*IN*/ uint2 size );
handle
size
uint2 that specifies the number of elements that will be stored in the vector.This function causes
eXtremeDB to allocate pages in the
database to hold the vector elements, which are subsequently assigned with
classname_fieldname_put_range() methods. If invoked on an existing
object, the vector is resized to size, truncating the vector if size is less than
the current vector size. If size is greater than the current size the vector is moved to a new
larger space; the space previously used by the vector is lost, so care should be taken not to reallocate
vectors too frequently.
The classname_pack() API can be used to defragment objects after multiple
vector reallocations, or the autocompact_threshold database parameter can be set to cause autocompaction
of an object on transaction commit if the objects size exceeds the specified threshold.
Note that this method is not generated for fixed size arrays.
MCO_S_OK
MCO_E_ACCESS
READ_ONLY.MCO_E_TRANSACT
MCO_E_DELETED
MCO_E_NOMEM
MCO_ERR_OBJECT_HANDLE
MCO_ERR_TRN_LONG
MCO_ERR_TRN