aldweb

Close I. aldweb

Close II. PC Freeware

Close III. Palm Freeware

Close IV. Palm Shareware

Close V. iziBasic Palm

Close VI. Palm Knowledge

Close VII. Pocket Computer

Close VIII. miniPortail

Special !



Mobile version of
the aldweb Site

m.aldweb.com


Neither French, nor English?

Try one of these flags then:
[de] [es] [it] [pt]
Search




Weather / Spam / www

Lyon Weather


aldweb against spam


Newsletter
To receive news about this website, consider subscribing to our Newsletter.
Subscribe
Unsubscribe
298 Subscribers
Family's web sites

Webmaster - Infos
Friends News
Visits

   visitors

   visitors online

Poll
What do you think of the new design of the aldweb Site?
 
Great !
Beautiful
Average
So ugly...
Results
forum.gifForum - iziBasic - Topic #1145

Forum - Forum
iziBasic - iziBasic


Warning: A non-numeric value encountered in /web5/aldweb/www/aldweb_com/www/thread.php on line 257

active  Topic # 1145  Problem with PP call?

05/03/2005 @ 18:05
by Steven

Anonymous



I'm working on a program that plots a bitmap at 160x160 or 320x320. The plots took too long in iziBasic (but much faster than PocketC ) so I coded the appropriate functions using PP. While I was developing the PP code I kept everything at 160x160 and everything worked well. Once I had everything working I changed one array in PP from 160 bytes to 320 bytes. Now it works but when I exit the iziBasic program I get

"MemoryMgr.c, Line:3757,
Invalid chunk ptr".

It happens whether I plot at 160x160 or 320x320. I don't understand how changing the array size affects this; 320 bytes isn't all that much! Any ideas?
Write to Steven   Post an answer  Top

Warning: A non-numeric value encountered in /web5/aldweb/www/aldweb_com/www/thread.php on line 497
Answer n° 1
--------
05/03/2005 @ 20:18
by aldweb

Anonymous

visitor
Hello Steven,

Thanks for confirming that iziBasic is much faster than PocketC. This was quite expected anyway (see here: Bench2 analysis).

Without having a look at your PP source code, it is quite hard to help you.

You talk of a 320 bytes size change.
But, as from reading you, I understand that:
1. a 160x160 byte array is a 25,600 bytes long array, roughly 25 KB.
2. a 320x320 byte array is a 102,400 bytes long array, roughly 100 KB, so 4 times bigger than the previous one!
And it overpasses the 64 KB common segment size on Palm OS or the 32 KB data segment size of PP.

Cheers

@+
aldweb
Write to aldweb   Post an answer  Top

Warning: A non-numeric value encountered in /web5/aldweb/www/aldweb_com/www/thread.php on line 497
Answer n° 2
--------
05/03/2005 @ 22:54
by Steven

Anonymous

visitor
I explained badly, it's not a 2 dimensional array. Only one dimension, so 160 bytes or 320 bytes plus there are two of them so 320 or 640. I changed my arrays from integer to UInt8 and it appears to be working, but let me ask a question. If I have a procedure defined prior to my CallPP function as:

type
myarray = array[0..320] of UInt8;

procedure myprocedure( var array1 : myarray);

.
.
.
function CallPP(.....);

Is this a problem?
Write to Steven   Post an answer  Top

Warning: A non-numeric value encountered in /web5/aldweb/www/aldweb_com/www/thread.php on line 497
Answer n° 3
--------
05/03/2005 @ 23:57
by aldweb

Anonymous

visitor
The PP integer type is a 32 bits integer type and it uses 4 bytes, when a byte (UInt8) uses 1 byte (2nd case seems obvious!).
So, array[0..320] is 321 bytes big, when it was 321x4=1284 bytes before.

We will have to check how much space of local variables is given in a PP module, out of the 32KB global variables space which is reserved by iziBasic.

You may very well declare many procedures and functions before the CallPP function itself.

Cheers

@+
aldweb
Write to aldweb   Post an answer  Top
active topic active   closed topic closed   Sticky Sticky   New New message   -   Correct Correct message   Close Close topic   Make sticky Make sticky
[]
Forum Topic  Forum 



 
^ Top ^