From: 'Matthew F. v. MLton-c. <mlt...@ml...> - 2020-09-21 13:49:46
|
Branch: refs/heads/master Home: https://github.com/MLton/mlton Commit: 47a781c3cd8c242c98466786c695e3ba1f605c00 https://github.com/MLton/mlton/commit/47a781c3cd8c242c98466786c695e3ba1f605c00 Author: Matthew Fluet <mat...@gm...> Date: 2020-09-20 (Sun, 20 Sep 2020) Changed paths: M CHANGELOG.adoc M runtime/gc/dfs-mark.c Log Message: ----------- Fix bug in handling of weak objects during mark-compact GC During a DFS marking, a weak object should only be linked if its objptr field is a valid object pointer (and not `BOGUS_OBJPTR`). This bug was introduced by commit ec2a3afa2, which changed `is{Objptr,Pointer}` predicates to `is{Objptr,Pointer}InHeap` predicates. This was motivated by the introduction of static heaps, because objects in the static heaps are not traced; in particular, objects in the immutable static heap are in read-only memory, and therefore cannot be marked and unmarked. However, the semantics of these predicates are subtly different. The `is{Objptr,Pointer}InHeap` return `TRUE` when the argument is a non-pointer (i.e., when `is{Objptr,Pointer}` returns `FALSE`). Commit 2d46cc122 fixed many of the `isPointerInHeap(p)` predicates to `isPointer(p) and isPointerInHeap(p)`, but missed the `isObjptrInHeap` that guards the linking of a weak object. Commit: e9f6cf4f992eace1357a5e6d84d4c5752ca73b1d https://github.com/MLton/mlton/commit/e9f6cf4f992eace1357a5e6d84d4c5752ca73b1d Author: Matthew Fluet <Mat...@gm...> Date: 2020-09-21 (Mon, 21 Sep 2020) Changed paths: M CHANGELOG.adoc M runtime/gc/dfs-mark.c Log Message: ----------- Merge pull request #415 from MatthewFluet/dfs-mark-weak-ptr-fix Fix bug in handling of weak objects during mark-compact GC Compare: https://github.com/MLton/mlton/compare/8857346cece4...e9f6cf4f992e |