[Mono-osx] MacOS bindings and MonoDevelop.

Rodrigo Kumpera kumpera at gmail.com
Tue May 12 19:29:44 EDT 2009


On Tue, May 12, 2009 at 7:16 PM, Евгений Гришуль
<eugeny.grishul at gmail.com>wrote:

> >Do you mean:
> >
> >    struct MyBase {
> >    }
> >
> >    struct Derived {
> >        MyBase xxx;
> >        foo bar;
> >    }
> ///===================
> No, I mean:
> struct NSObject { // for base classes in Objc hierarchy we holds pointer to
> Objective-C object in C# proxy
>     public IntPtr _handle;
>
>     public void SomeMethodAvailableForDerivedStructs() { somePInvoke(
> _handle ); }
> }
> struct SomeBaseObjcProxy : NSObject { // that not available in C#, but such
> inheritance work well on CLR (MS VES implementation)
>     public void AnotherMethodAvailableForDerivedStructs() { somePInvoke(
> _handle ); } // note that "_handle" is field of NSObject
> }
> ///===================
> In raw Objective-C you can't work with OBJECTS directly but can work with
> them via POINTERS to OBJECTS. My approach - is represent such pointers via
> structs with size of such pointer. Creating classes ( mobjc,monobjc,cocoa# )
> for such case leads to unnecessary GC overheads, structs there perform
> better.
> ///===================
>

This is not accurate, since your approach box the valuetypes, they impose
the same overhead as reference types. The MS runtime supports this by
accident, as this is not something defined my the ECMA standard and is type
unsound.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.ximian.com/pipermail/mono-osx/attachments/20090512/3bc051f8/attachment.html 


More information about the Mono-osx mailing list