Darwin Help

Back to Index

size

Function size - number of words used by the entire object

Calling Sequence  size(obj)
Parameters
NameTypeDescription

obj anythingany object
Return Type  {0,posint}
Synopsis Returns the total number of words used by the representation of the obj in memory. This is the number of words, which depending on the hardware will be 32 or 64 bits words. See version() for this information. This should be used mostly for comparative purposes, when two alternatives for representing some information have to be evaluated. Size will not count the name of the Class for data structure objects, under the assumption that this name is defined only once and used too many times. Other objects, even if used repeatedly will be counted entirely.
Examples
> size('');
3
> size({1,2,{a,b,c}});
21
> size([1,2,3,4]);
7
> size([1.2,2.2,3.2,4.2]);
19
See also assemble,   Class,   CreateArray,   disassemble,   length,   version