blob: 9df18d8ebb2b510c443e52daec9d8811f450f533 [file] [log] [blame]
MG Mud User88f12472016-06-24 23:31:02 +02001SYNOPSIS
Zesstra01c02872019-03-01 21:51:21 +01002 int sizeof(mixed * val)
3 int sizeof(string val)
Zesstrad59c3892019-11-28 20:53:39 +01004 int sizeof(bytes val)
Zesstra01c02872019-03-01 21:51:21 +01005 int sizeof(mapping val)
6 int sizeof(struct xxx val)
MG Mud User88f12472016-06-24 23:31:02 +02007
Zesstra715ec202025-07-09 22:18:31 +02008DESCRIPTION
9 Returns the number of elements of an array or struct, the number of
10 characters in a string, number of bytes in a byte sequence, or the
11 number of keys in a mapping.
MG Mud User88f12472016-06-24 23:31:02 +020012
Zesstra715ec202025-07-09 22:18:31 +020013 As a special case, the number 0 can be passed, and the function
14 will return 0.
MG Mud User88f12472016-06-24 23:31:02 +020015
Zesstra715ec202025-07-09 22:18:31 +020016 If there were any objects destroyed in the game since the mapping was
17 last checked for destructed keys, the mapping() needs to be checked
18 for destructed objects in keys first. In that case, the runtime
19 increases linear with the number of keys in the mapping (O(n)).
20 Otherwise the runtime is independent of the mappings size (O(1)).
Zesstra01c02872019-03-01 21:51:21 +010021
Zesstra715ec202025-07-09 22:18:31 +020022HISTORY
23 LDMud 3.2.9 added strings to the possible parameters.
24 LDMud 3.3 added support for structs.
Zesstra01c02872019-03-01 21:51:21 +010025
Zesstra715ec202025-07-09 22:18:31 +020026SEE ALSO
Zesstra01c02872019-03-01 21:51:21 +010027 strlen(E), allocate(E), pointerp(E), mappingp(E), m_allocate(E),
Zesstra715ec202025-07-09 22:18:31 +020028 widthof(E), text_width(E)