Simba Code:
var
x, y: String;
a: integer;
b: array[0..3] of char;
z: t2dintegerarray;
begin
y:= '123123123123';
writeln(sizeof(x));
writeln(sizeof(y));
writeln(sizeof(a));
writeln(sizeof(b));
setLength(z, 100);
setLength(z[0], 100);
writeln(sizeof(z));
end.
end.
1. SizeOf() returns 4 for all of them, so does it mean that they all took up exactly the same amount of RAM during run time? (4bytes each?) esp the last variable 'z'?
2. Is it true in simba that 4 byte data types have better speed performance than say, 2 byte data types due to data alignment etc?
So for example, int32 should be used over int8 unless memory is of greater concern than speed?
3. Is RAM consumed for declared methods too (both unused/invoked)? Exactly how much RAM would be used for, say, a null method?
@nielsie95
@Brandon
@Dgby714