-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
implement subslice sharing annotation #3
Comments
Yeah, this is not trivial. FWIW, |
That is fine, but does not correctly describe the situation I'm worried about. Note that utter only ever takes a single value, so we only need to be consistent within that value. Say we have:
We would like to have annotation that shows that a change to A possible approach is to use address annotation like so:
The current pre-dump walk I do can get this information with some extension. |
The issue is further complicated. Take the following:
The previous approach to rendering
The necessary work to prepare for this is building a map of overlapping slices (the map would contain one memory interval for each set of overlapping slices by the end of the walk) for each elem type. The address of the first left-most slice (lowest index in the backing array) needs to be retained - this becomes the reference slice. During rendering, the reference slice is rendered as the entire slice, marking its address and slicing to the appropriate length. All other slices are rendered as marked subslices of the backing slice. When the backing data is an array or array pointer, then the prefix to the address in marked subslices is An additional complication is how/if to render caps of the reference slice (or at all) - it can not be capped at an index less than the longest referring slice. At this stage, I will ignore that, though consider just using a comment unless there is another uncapped slice to use as a reference slice. Others subslices are easy since the is no problem with actually showing the cap with Go syntax. If this is implemented, it is disruptive enough to need a config option and not be on by default. |
This is an extension of #2. It is not clear how to address this though.
For example, if we have
How should this be rendered?
The text was updated successfully, but these errors were encountered: