[sgen] Add an assertion.
authorMark Probst <mark.probst@gmail.com>
Thu, 19 May 2016 01:39:21 +0000 (15:39 -1000)
committerMark Probst <mark.probst@gmail.com>
Wed, 25 May 2016 22:12:37 +0000 (15:12 -0700)
mono/sgen/sgen-gc.c

index 41843b19cc788f351ee7fd94c3ca211b16db227b..aaddedfb5ca63517c5731d2779568ce0818f3aed 100644 (file)
@@ -727,6 +727,8 @@ pin_objects_in_nursery (gboolean do_scan_objects, ScanCopyContext ctx)
 void
 sgen_pin_object (GCObject *object, GrayQueue *queue)
 {
+       SGEN_ASSERT (0, sgen_ptr_in_nursery (object), "We're only supposed to use this for pinning nursery objects when out of memory.");
+
        /*
         * All pinned objects are assumed to have been staged, so we need to stage as well.
         * Also, the count of staged objects shows that "late pinning" happened.