Skip to content

Flush the logger after each leak report - #2

Closed
stuartparmenter wants to merge 1 commit into
mainfrom
flush-leak-reports
Closed

stuartparmenter wants to merge 1 commit into
mainfrom
flush-leak-reports

Conversation

@stuartparmenter

Copy link
Copy Markdown
Contributor

A logger that buffers could lose leak reports if the process exited without flushing. Failed checks already flushed; leak reports didn't.

Each report line now flushes the logger, except a block's per-allocation lines, which the block's closing line flushes. A big leak costs one flush per block rather than one per allocation.

The exception is memory freed while still mapped: that report flushes once per allocation with VMA's locks held, because the macro can't tell the call sites apart without patching VMA. It only happens on a caller bug, and the crate docs say so.

Not tested: a real GPU. The new test uses a virtual block.

@stuartparmenter
stuartparmenter deleted the flush-leak-reports branch November 30, 2026 21:03
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.

1 participant