Alexander Smirnov wrote:
> Hello 
> 
> I want to use mono embeding. 
> But I don't quite understand how the memory management is done when using 
> mono objects from C code. 
> For example, there is mono_string_new() function which creates a mono string. 
> This string belongs to mono - am I right? 
> So how mono garbage collector knows when to delete the string? 
> Or should I tell it to do that? But I didn't found any function to release 
> mono objects from C, particulary MonoString objects. 

MonoObject and structures derived from them (MonoString, MonoArray, 
etc.) are controlled by the GC even when used in embedding scenarios.
There is no way to free them, because the GC is taking care of
this.

This also means that you cannot store MonoObjects into memory locations
(other than the stack) w/out using GC handles (see mono_gchandle_*
functions).

Robert


_______________________________________________
Mono-list maillist  -  [email protected]
http://lists.ximian.com/mailman/listinfo/mono-list

Reply via email to