Terrence Enger wrote:
Lorraine has since answered, and her answer rules out the possibility I
was thinking of. To wit, if wa retained its value from one call to the
next but arrayPtr was procedure-local, then the procedure could try to
realloc without having done the alloc.

...but she ran the code in debug and arrayPtr had the same value at the time of the %realloc that it had at the time of the %alloc. That being the case, the value of arrayPtr couldn't have been lost when the procedure ended (if the value was lost, it would show *NULL in the debug)

The 'wa' variable is only used at the moment the %alloc() or %realloc() is called, it doesn't matter what it's value is at other times. If it lost it's value, you might end up calling %realloc() with the wrong size, which is a bad thing, but would be perfectly legal from the operating system's perspective, so it wouldn't generate an error.


This thread ...

Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2019 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].