×
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.
Hello Lim,
is there a reason to ever use dealloc without the (n) extender?
When dealloc was first introduced into the RPG language, it didn't have
an (N) extender... if you want to support older releases, you'll have
to omit the (N) indicator. (Sorry, I can't remember which release (N)
was introduced in.)
Personally, I've never seen any value in specifying (N). I guess you'd
use that to verify that your code doesn't accidentally reference memory
that has been deallocated -- but keep in mind that (N) only sets the
pointer you give in the result field to *NULL. It doesn't set any other
pointers you've used in your code, so they might still reference the
deallocated memory. Furthermore, I tend to encapsulate pointer logic
into procedures, and in that scenario, the "free" (or "deallocate")
procedure tends to receive the pointer by value -- therefore, setting it
to null serves no purpose.
So I'm hard-pressed to find much value to the (N) extender. Granted, it
doesn't hurt anything -- but it rarely provides any value for me.
As an Amazon Associate we earn from qualifying purchases.
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.