Repository navigation
Wrap: follow-ups of #913 - #918
Merged
Merged
Conversation
The markers none, unchanged and modified were the immediates 0, 1 and 2, which the result of a wrapper can also be. The wrapper of a shared value returning 0, None or [] ran again; a value whose wrapper returned 1 or true was sent unwrapped, and failed to marshal; a wrapper returning 2 failed an assertion. The markers are now blocks allocated once and compared physically.
When a block could not be found in the table of the traversal, even after a rehash, get_index printed whether the block was marked on stderr, and checked that the block was nowhere in the table, before failing its assertion. The assertion alone reports the broken invariant.
The traversal indexes blocks by their addresses and only detects the minor collections that move them, so it disables heap compaction by setting max_overhead. OCaml 5 ignores max_overhead and only compacts the heap on an explicit call to Gc.compact: the settings are now left untouched there. The reason for disabling compaction is documented.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Follow-ups of #913 in
Wrap.test-unit-moreafter Test suite, step 2a: more unit tests; fix double wrapping after a GC #913 had been merged into master, so it never reached master. The markersnone,unchangedandmodifiedwere the immediates 0, 1 and 2, which the result of a wrapper can also be: a shared value whose wrapper returned 0,Noneor[]was wrapped twice, 1 ortruefailed to marshal, 2 failed an assertion. They are now allocated blocks compared physically, with the testwrap / immediate resultsand an entry inCHANGES.Tbl.get_index. It printed on stderr whether a block missing from the table was marked, before failing an assertion that already reports the broken invariant.max_overhead. OCaml 5 ignoresmax_overheadand compacts only on an explicitGc.compact, so the GC settings are now left untouched there. The reason is documented. The OCaml 4 path is unchanged and is exercised by thewrap / wrapper exceptiontest in the OCaml 4 CI jobs.