Page 1 of 1

PostPosted: Sun Nov 16, 2003 6:40 pm
by cable_guy_67
I seem to have a problem with some code when it is run on a palmV with OS3.3 Follows is the code that generates the problem:

Code: Select all
pointer prize_list, gameboard;
string data;



// prize_list is 2*4*8 array of prizes to be won with the arch number stored in it.
prize_list = Array("i,2,4,8");

On POSE and an actual device the following is generated
Virtual Machine Error
Addr: 43267
Func: my_function
Global ref out of range

This exact compile works fine on the other 3.5+ Roms and devices I have tested on. It appears that after the 24th call to substr() , (when z goes from 0 to 1) things get hinky. Am I missing something simple? This is the first time I call Array() or substr() in my code.

Thanks for any help.


PostPosted: Sun Nov 16, 2003 9:06 pm
by jstadolnik
Your code sample works flawlessly on the emulator using an OS3.3 rom. Your program is likely running out of dynamic heap (scratchpad) memory.

OS3.5+ devices generally have around 192k of heap space, where as pre-OS3.5 devices only have around 36k. If you have a lot of buffers and large arrays around your app is probably using too much heap for OS3.3 (and earlier OS varients). See the HeapSize() PToolbox function and the "Screen Buffers Section" for more details on the dynamic heap.


The PToolboxLib guy.

PostPosted: Mon Nov 17, 2003 12:16 am
by cable_guy_67
Thanks Joe, I believe you are correct. I went back and found another programe that I had and it worked fine. Thanks for the info on HeapSize(). I will see how far I am overdrawing the bank and what I can do about it. Back to the drawing board.