Re: allocate() and free()
- Posted by Aku <aku at inbox.as> Dec 02, 2000
- 525 views
------------F32315416EE956A R> I don't trust your measurements. The O/S call, R> GlobalMemoryStatus(), requires you to set the first field R> in a structure before making the call, something you R> don't bother to do. It also says the values returned R> can change even if *nothing* happens in your program R> between calls - i.e. the external world can change these R> numbers independent of your program. OK, now I have set the first field of the struct MEMORYSTATUS and the result is same as first. If you don't trust me, you can try yourself. Here is attached testmem.zip that contains several files: checkmem.exe = compiled VB program to get memory status checkmem.* = the sourcecode of checkmem.exe usemem.exe = compiled VB program that fill a variable with 10 MB of spaces and can free memory to operating system usemem.vbp, usemem.frm, usemem.vbw = the sourcecode of usemem.exe usemem.exw = a euphoria program like usemem.exe usemem.prj = the IDE file... To try: run checkmem.exe run usemem.exe click 'get free memory' on checkmem.exe click first button on usemem.exe 'get free memory' again [free memory decreases] click second button on usemem.exe 'get free memory' again [free memory increases] close usemem.exe close checkmem.exe run checkmem.exe run usemem.exw click 'get free memory' on checkmem.exe click first button on usemem.exw 'get free memory' again [free memory decreases] click second button on usemem.exw 'get free memory' again [free memory does NOT increase] close usemem.exw close checkmem.exe ------------F32315416EE956A