[Mono-dev] Embedding Mono and HandleRef...

Thomas Wiest twiest at novell.com
Sat Dec 30 22:24:42 EST 2006


Robert Jordan wrote:
> You don't need HandleRefs when using icalls and the embedded API.
> Just declare the icalls as non-static and they will automatically
> get the MonoObject* pointer of the managed object:


Ah, very interesting. I assume this increases the ref count which 
assures that the object won't get collected until after the native code 
returns. Is that right?

Also, to pass the person struct IntPtr from C# to C, which is 
recommended; pass it as a parameter, or use mono_runtime_invoke to pull 
it out of the property? I would assume that passing it as a parameter is 
quicker since it saves a function call.


Thanks for your help, it's quite an eye opener.
Thomas



More information about the Mono-devel-list mailing list