Skip to content

[TOOLS] Add rbtree_walk() and optional dynablock size histogram#3558

Merged
ptitSeb merged 1 commit intoptitSeb:mainfrom
runlevel5:dynarec/block-histogram
Feb 25, 2026
Merged

[TOOLS] Add rbtree_walk() and optional dynablock size histogram#3558
ptitSeb merged 1 commit intoptitSeb:mainfrom
runlevel5:dynarec/block-histogram

Conversation

@runlevel5
Copy link
Copy Markdown
Contributor

Summary

  • Add generic rbtree_walk() function for in-order tree traversal with user callback
  • Implement optional dynablock size histogram printed at exit, showing distribution of x86 block sizes across buckets (1-8, 9-16, ... 8193+)
  • Disabled by default behind //#define DYNAREC_HIST, following the TRACE_MEMSTAT pattern in custommem.c

Ref #3554

Files changed

  • src/tools/rbtree.c — new rbtree_walk() (uses leftmost + successor for efficient in-order traversal)
  • src/include/rbtree.h — declaration with doxygen comment
  • src/box64context.c — histogram infrastructure (struct, callback, bucket definitions) and printing code in FreeBox64Context(), all behind #ifdef DYNAREC + #ifdef DYNAREC_HIST

Add rbtree_walk() for in-order tree traversal with user callback.
Use it to implement a dynablock size histogram printed at exit,
disabled by default behind //#define DYNAREC_HIST (following the
TRACE_MEMSTAT pattern). Ref ptitSeb#3554.
@ptitSeb ptitSeb merged commit fafdb6e into ptitSeb:main Feb 25, 2026
53 of 54 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants