AllocateMemory: what changed?
Posted: Sat Jul 17, 2004 7:16 pm
Well, first of all, I'm actually new to PureBasic ,though I made some cool additions to GPI's Charas.EX, original found on www.charas-project.net. Anyway, on the same project, I wanted to add some things to it, but the source didn't work on 3.90 of PB. Luckily somebody else fixed it (Chronic, on the Charas site). It compiles now, but there was some error that I wanted to fix.
If you downloaded the program (in the menu on top, click on Charas.EX) you can import your own resources you took from the Charas generators (currently only Charsets for Charas.EX). In the new source however there was a bug that when you did that the program would crash (actually, when you saved the imported resource). I've searched and added a lot of times the OpenWindow command, and I stumbled on the PokeB command in a for constructor. After long trying I found out that there probably wasn't enough memory to store, but I wondered how the AllocateMemory command worked.
mem=AllocateMemory(memory_import,#resource_uncompressed_size,0)
This was the original, that didn't work.
mem=AllocateMemory(memory_import)
This caused the crash.
mem=AllocateMemory(#resource_uncompressed_size)
This was the fix.
Well, I now am wondering, what does AllocateMemory do in the new version of PB? Does it now searches for the amount of free memory specified in the function? Because the help manual wasn't clear about that.
If you downloaded the program (in the menu on top, click on Charas.EX) you can import your own resources you took from the Charas generators (currently only Charsets for Charas.EX). In the new source however there was a bug that when you did that the program would crash (actually, when you saved the imported resource). I've searched and added a lot of times the OpenWindow command, and I stumbled on the PokeB command in a for constructor. After long trying I found out that there probably wasn't enough memory to store, but I wondered how the AllocateMemory command worked.
mem=AllocateMemory(memory_import,#resource_uncompressed_size,0)
This was the original, that didn't work.
mem=AllocateMemory(memory_import)
This caused the crash.
mem=AllocateMemory(#resource_uncompressed_size)
This was the fix.
Well, I now am wondering, what does AllocateMemory do in the new version of PB? Does it now searches for the amount of free memory specified in the function? Because the help manual wasn't clear about that.