DirectStorage: walls trace file list only with the trace on; compressed bytes freed once inflated #375
No reviewers
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/Belobug--VIctory-Belobug-AMD!375
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-375"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
@Esteban-V on GitHub · 2026-11-26 22:50 UTC · original
Esteban-V:fix/dstorage-small-leaks→a-publier· +8 −2 · 1 files · 1 commits · openTwo small leaks in the DirectStorage module (
crates/victory-hle/src/modules/dstorage.rs).open_filepushed every opened file intoWALLS_FILES(dstorage.rs:157), but only the walls trace (VICTORY_WALLS_TRACE) reads that list, and nothing ever removed entries. In the zlib + BCPack path (dstorage.rs:1413), the compressedsourcebuffer was shadowed rather than dropped, so it stayed allocated while BCPack unpacked. This fixes both.WALLS_FILESis now filled only when the walls trace is on.walls_requestsearches from the back, so an object address reused by a later open names the newest file.sourcebuffer is dropped right after inflating.Already merged in DoubleGhosty/cool_fox (a96549d).
Testing
windows-latest): Clippy, default tests and diagnostics tests pass (run).x86_64-pc-windows-msvcon a macOS host (cargo clippy --workspace --all-targets -- -D warnings, default features and--all-features).@lvndrpup on GitHub · 2026-11-27 05:25 UTC · original · reviewed
A native Windows run, beside your CI run and the macOS check, at
b1fb923on Windows 11 build 26300, Rust 1.98.1, debug:cargo test -p victory-hle: 165 passed, 0 failed (dstoragealone: 18 passed, 1 ignored).cargo clippy -p victory-hle --all-targets -- -D warnings: clean, with and without--all-features.I also checked the two points the change rests on:
walls_requestreturns at once whenwalls_trace()is 0 (dstorage.rs:672), andwalls_trace()is read once per process (OnceLock). So leavingWALLS_FILESempty without the trace loses nothing.sourceis theCow<'static, [u8]>fromread_source. For a file it is the owned read buffer, so the newdropfrees it before BCPack runs; for a memory source it is borrowed and the drop does nothing.@Esteban-V on GitHub · 2026-11-27 14:34 UTC · original
Thanks for running it natively, and for checking the
OnceLockand the borrowed case. That's the part I most wanted another pair of eyes on.View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.