At 10:40 AM -0300 5/19/04, Zechner Christian wrote:
Hello!

I allocate memory with the 'new' operator.

For example:

Char *p;
p= new char[1024*1024];

And I haven't problems.

But I don't allocate chunk memory, and I allocate more than 64KB.

Is it correct?
Why can I allocate more than 64Kb?

I don't think that you're allocating more than 64K. I think that you're allocating zero bytes. 1024 * 1024 in decimal is 0x400 * 0x400 in hex, which results in 0x00100000. However, you are performing your operation with ints, which are 16-bit values in 68K palm applications. Thus, the result is truncated to 16 bits, which is 0x0000.


Try "p= new char[1024L*1024L];" if you want to see your allocation fail. :-)

-- Keith

--
For information on using the Palm Developer Forums, or to unsubscribe, please see 
http://www.palmos.com/dev/support/forums/

Reply via email to