[sgen] Fix critical/normal finalization order at domain unload
authorVlad Brezae <brezaevlad@gmail.com>
Fri, 15 Jul 2016 10:22:04 +0000 (13:22 +0300)
committerVlad Brezae <brezaevlad@gmail.com>
Tue, 19 Jul 2016 20:37:13 +0000 (23:37 +0300)
commit629529eceabb460e8476a9ca597ff25706de4f42
tree71288320bdadfd5c044093502a2c3ce7a5d6955c
parent725892b35c29fe919d6e58305ac241f6cbd01018
[sgen] Fix critical/normal finalization order at domain unload

For objects that die at the same time, normal finalizers should be run before critical finalizers. When we were unloading a domain we were running finalizers for all objects in that domain without checking whether the finalizer is critical or not. Now we enqueue the objects first in the finalization queues so we can run all the normal finalizers before the critical ones.
mono/metadata/gc-internals.h
mono/metadata/gc.c
mono/metadata/sgen-mono.c
mono/sgen/sgen-fin-weak-hash.c
mono/sgen/sgen-gc.h