These docs are for v2.0. Click to read the latest docs for v3.0.

Compute the serialized size of an object in a slot

Behaviour

  • Return the number of bytes the object in the specified slot occupies when serialized

Definition

int64_t slot_size (
    uint32_t slot_no
);

Example

int64_t bytes_needed = slot_size(1); // get size of slot 1

Parameters

NameTypeDescription
slot_nouint32_tThe slot number

Return Code

TypeDescription
int64_tThe number of bytes the object occupies when serialized

If negative, an error:
DOESNT_EXIST
- the specified slot does not contain any object or it is an invalid slot