× 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.



The memory you allocate with %ALLOC() will be freed up when your program de-allocates it, or when the activation group ends. (Which will happen automatically if the job ends.)

In your original message you say "after the service program is destroyed from the activation group?". I don't exactly understand what that means... how can a service program be "destroyed from the activation group"?? Do you mean that the activation group has ended? Or do you mean that the service program has returned to the caller? AFIAK, there's no way to remove a service program from memory without reclaiming the activation group.

Anyway -- the point is... your memory from %ALLOC will remain til the activation group ends. So it's not safe to use after the activation group ends.

I asked for more info before because you didn't say where the memory came from... if it was allocated in a user space, or if it was a field in the service program, or in static/automatic storage within the service program, etc, then my answer might've been different.


Lim Hock-Chai wrote:
Can you be more specific?

In my service program, I do %alloc(%size(myDS)). This allocated memory
is then added to the list like myDSLast.next = myDS.... (The standard
link list stuff)


As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

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.