Repository navigation
Recursion tree: show a node's value next to its name - #36
Merged
Merged
Conversation
A pointer argument or return value was labelled with the heap object's name only (pre_order(a3)), so telling which node a call was on meant opening Memory. Labels now add the object's first plain field, such as val or data: pre_order(a3:1). Values over 11 characters are left out. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
Problem
A call that takes a node pointer was labelled with the heap object's name only, e.g.
pre_order(a3). To know which nodea3was, you had to open Memory. It also hid bugs: in this pre-order program the constructor doesval = val;, a self-assignment, so novalwas ever set, and the tree gave no hint of it.Change
Pointer arguments and pointer return values now show the object's first plain (non-pointer) field after its name:
pre_order(a3:1)→pre_order(a4:2)→pre_order(a6:3), thenpre_order(a5:4)for the tree 1(2(3), 4)pre_order(a3:-1163005939), the Windows debug heap's0xBAADF00Dfill, visible straight awayValues longer than 11 characters are dropped, and the label falls back to the name alone. The name stays because it matches the Memory tab.
Checks
this->val = val: labels as above, with the sticky note and breadcrumb using the same text.tsc,npm run buildand the 13 Node tests pass.docs/usage.mddescribes the label.🤖 Generated with Claude Code