yes, I know that t frees them, when no other managed reference is pointing.
But right after I create a string using: MonoString* str=mono_string_new (domain, "some text"); no managed references point to this string because MonoString* str is not a manged reference. So can GC delete "str" right after mono_string_new? thanks for your help 20.11.09, 14:56, "Robert Jordan" <[email protected]>: > Alexander Smirnov wrote: > > But how GC knows when to free such objects? When it frees such objects? > > It frees them, when no other managed reference is pointing > to them. > > > Could GC free the object when I still need it? > > for example > > > > void func() { > > MonoString* str=mono_string_new (domain, "some text"); > > /* > > could GC free str before "using str", if no, why? > > */ > > // using str > > } > > > If you want to use "str" after func () in unwound, then > you have to obtain a gchandle for "str". See Mono's > mono_gchandle_* functions. > > Robert > > _______________________________________________ > Mono-list maillist - [email protected] > http://lists.ximian.com/mailman/listinfo/mono-list > > -- Alexander Smirnov Яндекс.Почта. Письма есть. Спама - нет. http://mail.yandex.ru/nospam/sign _______________________________________________ Mono-list maillist - [email protected] http://lists.ximian.com/mailman/listinfo/mono-list
