feat: Implement granular heap walking for Linux (Resolves #12)#91
Merged
SickleFire merged 1 commit intoJul 8, 2026
Merged
Conversation
SickleFire
approved these changes
Jul 8, 2026
SickleFire
left a comment
Owner
There was a problem hiding this comment.
Code quality: Well-structured refactoring that preserves existing behavior while improving default performance
Platform coverage: Properly gated with #[cfg(target_os = "linux")] to avoid affecting other platforms
LGTM! Approved. Merging this in!
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.
Pull Request Title
feat(linux): implement granular heap walking for LinuxDescription
This PR splits the existing
walk_heapfunction insrc/os/linux.rsinto two distinct functions to support granular heap parsing on Linux, achieving feature parity with Windows.walk_heapnow returns the entire[heap]region as a singleHeapBlockbased on/proc/<pid>/maps(improving default performance).walk_heap_granularhandles the detailed glibcmallocchunk parsing via/proc/<pid>/mem.get_heap_blocksinsrc/ui/commands.rsto invoke the granular variant on Linux when requested.Fixes #12
Code Snippets & Explanations
1. Faster Default Heap Walk (
walk_heap)Previously,
walk_heapon Linux would automatically parse detailed glibc memory blocks, slowing it down. Now, it treats the entire heap as a single region similar to the non-granular default behavior on Windows:2. Granular Heap Walk Implementation (
walk_heap_granular)The previous detailed logic reading
glibcchunk structures was shifted intowalk_heap_granular:3. Invoking the Granular Walk on Linux
Updated
get_heap_blocksinsrc/ui/commands.rsto call our newly exposed granular Linux logic when_granularis toggled on:Type of change
Related issues
How Has This Been Tested
cargo testpasses existing project constraints.cargo checkandcargo buildto ensure the new Linux specific conditionals compile successfully without unused variable warnings.Checklist
cargo build --release)cargo test)CI and Performance Notes
walk_heapon Linux is now significantly faster since it no longer parses individualmallocchunks. Granular chunk parsing is properly deferred towalk_heap_granularwhen explicitly enabled.Screenshots or Logs
(N/A)
Release Notes
walk_heap_granularsupport for Linux to maintain feature parity with Windows. Defaultwalk_heapon Linux is now more performant as it treats the entire heap region as a single contiguous block.