Welcome! Log In Create A New Profile

Advanced

[WX 23] memory size of an array of structures

Posted by pietvanz 
[WX 23] memory size of an array of structures
June 13, 2021 12:03PM
Hi,

I'm creating an undo buffer for changes a user makes.
This is an array of structures for each undo level. Every undo level contains an array of structures containing undo data.
This array can have one or many items.
Now I want to check the size of this undo buffer, to prevent it from growing too large.

Any ideas how to find the size of this array in memory?

Best regards,
Piet
Alexander Predl
Re: [WX 23] memory size of an array of structures
June 13, 2021 12:44PM
check Dimension()
Re: [WX 23] memory size of an array of structures
June 13, 2021 04:27PM
Hi Alexander,

Thanks, but that's basic stuff, I mean the size in memory.

Best regards,
Piet
Re: [WX 23] memory size of an array of structures
June 13, 2021 07:23PM
maybe with :

nsize = ArrayInfo(MyArray, tiTotalSize)


regards, Heinz
Re: [WX 23] memory size of an array of structures
June 14, 2021 12:08AM
Hi Heinz,

That might work.
It actually does not give the correct size of the "parent" array, but I can loop through it and it gives a seemingly correct size of the "child" arrays.
So I can add them up.

Thanks!
Piet
Author:

Your Email:


Subject:


Spam prevention:
Please, enter the code that you see below in the input field. This is for blocking bots that try to post this form automatically. If the code is hard to read, then just try to guess it right. If you enter the wrong code, a new image is created and you get another chance to enter it right.
Message: