Platforms to show: All Mac Windows Linux Cross-Platform

GetArrayAllocatedSizeMBS(v as variant) as integer   Deprecated

Type Topic Plugin Version macOS Windows Linux iOS Targets
global method XojoRuntime MBS Util Plugin 20.0 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
This item is deprecated and should no longer be used.
Queries allocated array size in bytes.
Example
Dim a() As Integer // 8 byte per integer in 64-bit

System.DebugLog "allocated: "+Str(GetArrayAllocatedSizeMBS(a))

Redim a(9) // changes to 80 bytes

System.DebugLog "allocated: "+Str(GetArrayAllocatedSizeMBS(a))

Redim a(19) // changes to 160 bytes

System.DebugLog "allocated: "+Str(GetArrayAllocatedSizeMBS(a))

a.Append 123

System.DebugLog "allocated: "+Str(GetArrayAllocatedSizeMBS(a))
// shows 288, adds space for 16 more values

This function uses internal knowledge of the array layout in memory.
So this will break in case a future Xojo version changes the layout.
Please use only carefully for debugging.

Stopped working on Windows in recent Xojo versions, so we deprecated it.

The items on this page are in the following plugins: MBS Util Plugin.


The biggest plugin in space...