Reputation: 2291
This question has a relation with my previous question, What is the “real” memory size occupied by a dynamic array?
var
AText: array [0..6] of AnsiChar;
What is the real size of AText occupied in memory? Is it really 7 bytes?
Upvotes: 5
Views: 297
Reputation: 26356
I think so. Maybe D2010+ adds some reference to the RTTI record.
Then there is also alignment, the next variable/field might not start directly after this variable/field leaving some slack bytes. (typically round up to some power of 2 like 16)
Note that alignment might be different for a local and a global variable, class var etc. The various segments all can have different alignment rules, and if it is a field/class var it might be different still.
Upvotes: 1