On Jan 16, 2014, at 9:49 AM, Thomas Tempelmann <notifications@github.com> wrote:

> In macoslib/Cocoa/NSMutableDictionary.rbbas:
> 
> >  		  #endif
> >  		  
> >  		End Sub
> >  	#tag EndMethod
> >  
> >  	#tag Method, Flags = &h1000
> > +		Sub Constructor(otherDictionary as NSDictionary)
> > +		  
> > +		  #if targetMacOS
> > +		    declare function initWithDictionary lib CocoaLib selector "initWithDictionary:" (obj_id as Ptr, otherDictionary as Ptr) as Ptr
> > +		    
> > +		    super.Constructor(initWithDictionary(Allocate("NSMutableDictionary"), otherDictionary), NSMutableDictionary.hasOwnership)
> 
> Yeah, it was just something that I wondered about. I am all for efficiency and hate thinking that if I create 1000s of objects, they all do something repetative that could be easily avoided. I realize that this has been going on for long already, though. Still, if there's a better way, we should at least start doing it better in newly added code. Looks like we'd need a Allocate function that takes a Ptr and then pass it ClassRef?
> 
> —
> Reply to this email directly or view it on GitHub.
> 


There is such an Allocate function.