delphi - How to get the memory size of a dynamic array? -


in delphi, can size of value type sizeof() compiler magic function, calling sizeof() on reference type give size of pointer, not of value it's pointing to.

for objects, can memory size instancesize method, dynamic arrays? due padding, length(myarray) * sizeof(element) may not accurate. so, there accurate way memory size of dynamic array?

between elements of dynamic array there no padding, length(myarray)*sizeof(element) should accurate.


Comments