> From: Igor Mozolevsky
>
> Maybe that was a bad example, here's a better one:-
>
> # define FAILURE 1
> # define SUCCESS 0
> # define NIL 0
>
> UInt8 func1(void) {
> UInt8 foo; // reserves memory for 1 byte
> ...
> if(func2(&foo) != SUCCESS) // frees the reserved memory, or at
> least tries to...
> return FAILURE;
>
> return SUCCESS;
> }
>
> UInt8 func2(void *ptr) {
> ...
> if(MemPtrFree(ptr) == NIL)
> return FAILURE;
> }
>
I don't see what this is a "better example" of. foo is allocated on the
stack. You don't really think that MemPtrFree should be used to alter stack
space, do you?
--
For information on using the Palm Developer Forums, or to unsubscribe, please see
http://www.palmos.com/dev/tech/support/forums/