[Mono-dev] field pointer and garbage collection

Alex Rønne Petersen alex at alexrp.com
Wed Jun 11 14:39:13 UTC 2014


To know if an arbitrary pointer is a GC'd pointer, conceptually you need to ask:

1. sgen_ptr_in_nursery (ptr) ?
2. major_collector.is_valid_object (ptr) ?
3. sgen_ptr_is_in_los (ptr, &base) ?

If all of these are false, you know it's just some random pointer you
don't care about.

On Wed, Jun 11, 2014 at 4:03 PM, serus <fabian.nagel at gmail.com> wrote:
> I think this is the part that I do not understand. Can't the value on the
> stack (assuming the stack is being scanned conventionally and the value is
> not actually a pointer but a long) point to unallocated memory, or to memory
> that is allocated but not for objects but some runtime data structure?
>
>
>
> --
> View this message in context: http://mono.1490590.n4.nabble.com/field-pointer-and-garbage-collection-tp4663040p4663047.html
> Sent from the Mono - Dev mailing list archive at Nabble.com.
> _______________________________________________
> Mono-devel-list mailing list
> Mono-devel-list at lists.ximian.com
> http://lists.ximian.com/mailman/listinfo/mono-devel-list


More information about the Mono-devel-list mailing list