Re: [Mono-dev] Is it safe to save the MonoObject* pointer and use it latter?

2018-04-10 Thread Vincent Povirk
If you have the MonoObject pointer stored in a stack variable, and
assuming the Mono runtime is aware of your thread, then yes it is
safe. If the pointer is in static or heap-allocated memory, then the
object may be moved or freed.
___
Mono-devel-list mailing list
Mono-devel-list@lists.dot.net
http://lists.dot.net/mailman/listinfo/mono-devel-list


[Mono-dev] Is it safe to save the MonoObject* pointer and use it latter?

2018-04-09 Thread xiaozhu
hi,all:
I have a game engine embeded mono,and use the sgen gabage collector.


I know that sgen gc will move the Managed Object, so the Managed 
Object's address is not fixed.
Is it safe to save the MonoObject* pointer and use it latter without 
pinned?


MonoObject* managedObj = mono_object_new();
 save the managedObj . and manipulate it latter.




   Thank You___
Mono-devel-list mailing list
Mono-devel-list@lists.dot.net
http://lists.dot.net/mailman/listinfo/mono-devel-list