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



Does anybody know what will happen to the memory of myField1 after the
dealloc myField1_p statement?  Does it become available for used?   

------------------------------------------------------------------------
------------
D myField1        s             10    based(myField1_p)
D myField2        s             10    based(myField2_p)
                                                       
 /free                                                 
                                                       
  // allocate and inz field1                           
  myField1_p = %alloc(%size(myField1));                
  myField1 = 'AAAA';                                   
                                                       
  // make field2 same as field1                        
  myField2_p = myField1_p;                             
                                                       
  // dealloc field1, what happen to the memory (does it become
available?)
  // myField2 is still pointint to this memory location?        
  dealloc myField1_p;                                  
                                   
  // I'm still able to use it.  
  // Will the memory get use by other alloc operation because of above
dealloc? 
  myField2 = %trim(myField2) + 'BBB';                  
                                                       
  *inlr = *on;                                         
                                                       
 /end-free                                             


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.