On Fri, 3 Jan 2003, Smith, Nelson wrote:
>
> Yes, I am using %SIZE() on the initial allocate.  Is there a problem or
> gotcha with using this BIF?  I just tried replacing it with a hardcoded
> number and it made no difference.
>

No, quite the opposite.   Doing the calculations manually or using a
hard-coded number is error-prone and may lead to the problem that you're
describing.   Using %size() SHOULD be safe.

>
> If the value of the pointer at deallocate time is still the same as what was
> returned from the initial allocate, what else about it can be corrupted?
>

Pointers are very special entities on the iSeries.  They have to be
aligned on 16-byte boundaries, and they have special "tag bits" that are
not visible in STRDBG which have to be set properly.




This thread ...

Replies:

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

This mailing list archive is Copyright 1997-2026 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].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.