[Openmcl-devel] New (070408) OpenMCL snapshots available

Kevin Reid kpreid at mac.com
Mon Apr 9 06:56:39 PDT 2007


On Apr 9, 2007, at 2:54, Gary Byers wrote:

>     (#/initWithFrame: new-view (ns:ns-make-rect 100 100 200 200))
>
>     The rectangle above will -eventually- get reclaimed by the GC;
>     if you don't want to give the GC so much work to do, you might
>     prefer to do:
>
>     (ns:with-ns-rect (r 100 100 200 200)
>       (#/initWithFrame: new-view r))

This seems like it ought to be automatically optimizable.

Given that ns-make-rect is a function known to produce a GCable  
record and #/initWithFrame: is a function known not to store its  
arguments in the Lisp heap, said optimizer may be certain that the  
object will not necessarily be retained past the call, so  
deallocating it immediately after the call does not reduce its  
definite lifetime.

(I haven't yet used OpenMCL's FFI for anything, so this is just idle  
speculation and not a feature request.)

-- 
Kevin Reid                            <http://homepage.mac.com/kpreid/>





More information about the Openmcl-devel mailing list