[sgen] Document assertion.
[mono.git] / mono / sgen / sgen-gchandles.c
index 3fb721e39f9592366262ef468b1607d048d6d5b2..8797300a56cc444108e857648d888e74aba315f0 100644 (file)
@@ -236,6 +236,9 @@ handle_data_grow (HandleData *handles, guint32 old_capacity)
         */
        mono_memory_write_barrier ();
        if (InterlockedCompareExchangePointer ((volatile gpointer *)&handles->entries [new_bucket], entries, NULL) == NULL) {
+               /* It must not be the case that we succeeded in setting the bucket
+                * pointer, while someone else succeeded in changing the capacity.
+                */
                if (InterlockedCompareExchange ((volatile gint32 *)&handles->capacity, new_capacity, old_capacity) != old_capacity)
                        g_assert_not_reached ();
                handles->slot_hint = old_capacity;