Make instruction.next mutable in Mach#629
Closed
mshinwell wants to merge 1 commit intoocaml:trunkfrom
Closed
Conversation
Member
|
Looks good. Does any back-end expert have an opinion? |
Contributor
|
I could have an opinion if I saw some of the instrumentation code in question. Why is it problematic to rebuild a new immutable list with the instrumentation code inserted in the right places? In-place mutation is always more error-prone, so I'm not encouraging anyone to go down this path. |
Contributor
Author
|
@xavierleroy https://github.com/mshinwell/ocaml/blob/spacetime/asmcomp/spacetime_profiling.ml, function |
Contributor
Author
|
I've figured out another way of doing this, I think, which doesn't require making it mutable. I will re-open this if it fails. |
EduardoRFS
pushed a commit
to esy-ocaml/ocaml
that referenced
this pull request
Dec 17, 2021
Backtrace last exn is val unit
stedolan
pushed a commit
to stedolan/ocaml
that referenced
this pull request
May 24, 2022
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.
Insertion of instrumentation code on Mach is complicated by the use of singly-linked lists, in reverse order, with no means of obtaining a reference to the "next" field (since it is a mutable field in a record).
I propose to make the
nextfield inMach.instructionmutable, which makes this task significantly easier.