Integer Memory
BlitzMax Forums/BlitzMax Beginners Area/Integer Memory From the manual:
Also, MemAlloced and program initialization itself uses memory, try:
Function MemAlloced() Memory currently allocated by application
Returns: The amount of memory, in bytes, currently allocated by the application
As opposed to say "Ammount of memory used by your variables". You'll notice that your code reports different results depending on whether it's running in debug or not.Returns: The amount of memory, in bytes, currently allocated by the application
Also, MemAlloced and program initialization itself uses memory, try:
FlushMem() Print MemAlloced() FlushMem() Local a:Int = 34 Print MemAlloced()
I see. So everytime you call MemAlloced, it takes up another
20 bytes.
From that thread, Vanilla said:
The variables are initialised at init time, before your first
command can be executed.
That's interesting. How can the program know what
variables you will use before your program runs? It can't, can it?
20 bytes.
From that thread, Vanilla said:
The variables are initialised at init time, before your first
command can be executed.
That's interesting. How can the program know what
variables you will use before your program runs? It can't, can it?
Memalloced will use 20 bytes which are recovered by flushmem.
Your program is compiled so knows which variables will be used but not what their values will be during runtime.
Your program is compiled so knows which variables will be used but not what their values will be during runtime.
Integers will be in a block of memory allocated as soon as the program runs - so you won't see any change at the line where they are allocated. Create some types or an integer array which are dynamically allocated and I would expect to see a change.