Okay.  Well yeah, I shouldn't assume the garbage collector will never
be rewritten.

--
Mark Miesfeld

On Tue, Sep 8, 2009 at 4:42 PM, Rick McGuire<object.r...@gmail.com> wrote:
> Yes, this is safe....currently.  However, the success of this depends
> entirely on the characteristics of the garbage collector.  You
> shouldn't assume that the reference passed directly to your method is
> necessarily a direct reference to the object, so good practice
> dictates you should request a global reference for that object.
> Should the garbage collector ever get rewritten to use some other
> algorithm, such as a compacting garbage collector, not requesting the
> global reference could cause problems.
>
> Rick
>
> On Tue, Sep 8, 2009 at 7:35 PM, Mark Miesfeld<miesf...@gmail.com> wrote:
>> If you have a class defined in the package file for an external native
>> library and wanted to stash the class object in the native code, you
>> wouldn't need to request a global reference for it would you?  Or
>> would you?  (This is to prevent it from being garbage collected.)
>>
>> I'm thinking that the class object would always be around until the
>> package is unloaded.  For example, in the ooDialog package, I have a
>> Size class defined:
>>
>> ::class 'Size' public
>>
>> Then in the native code, I do a FindContextClass("SIZE"), over and
>> over each time I need to create a new  Size object.  I was thinking of
>> doing a lazy lookup, the first time I need the Size class object do
>> the FindContextClass("SIZE") and then keep the reference to the class
>> object so it doesn't need to be looked up again.
>>
>> My assumption is the class object is never garbage collected while the
>> package is loaded.  But, I'm not sure if that is a valid assumption.
>>
>> --
>> Mark Miesfeld
>>
>> ------------------------------------------------------------------------------
>> Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
>> trial. Simplify your report design, integration and deployment - and focus on
>> what you do best, core application coding. Discover what's new with
>> Crystal Reports now.  http://p.sf.net/sfu/bobj-july
>> _______________________________________________
>> Oorexx-devel mailing list
>> Oorexx-devel@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/oorexx-devel
>>
>
> ------------------------------------------------------------------------------
> Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
> trial. Simplify your report design, integration and deployment - and focus on
> what you do best, core application coding. Discover what's new with
> Crystal Reports now.  http://p.sf.net/sfu/bobj-july
> _______________________________________________
> Oorexx-devel mailing list
> Oorexx-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/oorexx-devel
>

------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with 
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
Oorexx-devel mailing list
Oorexx-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/oorexx-devel

Reply via email to