Where's My Modules?

BlitzMax Forums/BlitzMax Beginners Area/Where's My Modules?

Mental Image(Posted 2006) [#1]
I have the latest version of BlitzMax (1.14 having just updated from 1.09).

If I try to compile something with "FlushMem" in it, I get a "Flushmem Identifier Not Found" error.

I have had similar errors with other code samples.

Any ideas?


Bremer(Posted 2006) [#2]
Flushmem is no longer needed. Bmax now handles garbage collection for you. There are a few other changes, but take a look at the versions.doc file in your bmax folder for more info.


Eric(Posted 2006) [#3]
Flushmem was removed from Blitzmax. It's garbage collection is automatic unless , you go manual.
Function GCSetMode( mode ) 
Description Set garbage collector mode. 
Information mode can be one of the following:
1 : automatic GC - memory will be automatically garbage collected
2 : manual GC - no memory will be collected until a call to GCCollect is made
The default GC mode is automatic GC.

Function GCCollect() 
Returns The amount of memory, in bytes, collected. 
Description Run garbage collector. 

Function GCMemAlloced() 
Returns The amount of memory, in bytes, currently allocated by the application. 
Description Memory allocated by application. 
Information This function only returns 'managed memory'. This includes all objects, strings and arrays in use by the application.



Perturbatio(Posted 2006) [#4]
it should be noted that you don't need to set the mode to manual to use GCcollect, it just collects when it wants AND when you tell it to.

you could either do a search and replace on Flushmem, or use this:
Function Flushmem
   GCCollect()
End Function



taxlerendiosk(Posted 2006) [#5]
If you want to be needlessly quirky, you could try this:
Global FlushMem() = GCCollect
...although I haven't actually tried it myself and it might not work.


Perturbatio(Posted 2006) [#6]
...although I haven't actually tried it myself and it might not work.


Actually, it appears to.