× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



So what's the recommended way of "unpointing" the pointer or knowing if a
pointer has been set?

I'm checking for a null value simply by comparing the pointer with one that
is never used in the program.
myPointer *
NullPointer * inz(*null)

If myPointer <> NullPointer
myPointer = NullPointer
endif

But this doesn't seem right to me





date: Wed, 21 Jul 2021 14:31:00 -0400
from: Barbara Morris <bmorris@xxxxxxxxxx>
subject: Re: Pointer Reset operation?

On 2021-07-20 3:20 p.m., Carel via RPG400-L wrote:
Is REALLOC not an option?


I don't think it would be valid for the RPG program to use REALLOC.
Reallocating a pointer does not necessarily give the same pointer back,
and YAJL would still have a pointer to the old storage. The old storage
would not "belong" to YAJL any more, and if YAJL changed it, it could
cause storage corruption for something else now using the storage.

Same with DEALLOC. That frees the storage, and possibly sets the -local-
copy of the pointer to null, but it would not set the YAJL pointer to
null, so YAJL would still have its pointer to the storage. But again,
the storage would not "belong" to YAJL any more, so storage corruption
could occur.

--
Barbara



As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:

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

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