Skip to content

Report failed checks and leaks through log and remove vmaSysSetHandlers - #1

Merged
stuartparmenter merged 1 commit into
mainfrom
report-through-log
Nov 4, 2026
Merged

stuartparmenter merged 1 commit into
mainfrom
report-through-log

Conversation

@stuartparmenter

@stuartparmenter stuartparmenter commented Nov 4, 2026 •

Copy link
Copy Markdown
Contributor

vmaSysSetHandlers is process-wide, so a host app and a library that both set it overwrite each other with no warning. Leak reports also said nothing about which allocation leaked. This removes the handlers and reports through log, which already has one app-owned global sink.

  • A failed check goes to stderr, then log, then the logger is flushed and the process aborts. Stderr comes first because a logger can drop or hold a message, and an abort would lose it. This also covers libtest capture.
  • A leak report goes to log at error level with the target LOG_TARGET, or to stderr if log_enabled! is false for that target.
  • VMA_LEAK_LOG_FORMAT is defined, so leaks now list offset, size and name. The crate docs state the limits: dedicated allocations aren't listed, virtual allocations have no name, and no line says which block it came from.
  • log is a required dependency. The crate stays no_std.

Breaking: vmaSysSetHandlers, VmaSysCheckFailedHandler and VmaSysLeakHandler are gone.

Not tested:

  • Linking and symbol export on macOS beyond this PR's CI, including whether a macOS or Windows cdylib exports vma_sys_log. Hiding it covers ELF only.
  • x86_64-pc-windows-gnu.
  • A real GPU. The allocator paths ran against a stub Vulkan device.
  • Stderr in a Windows GUI app with no console.

@stuartparmenter stuartparmenter added the breaking-change Breaking API change label Nov 4, 2026
@socket-security

Copy link
Copy Markdown

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Addedlog@​0.4.3510010093100100

View full report

@stuartparmenter
stuartparmenter merged commit 579fa53 into main Nov 4, 2026
12 checks passed
@stuartparmenter
stuartparmenter deleted the report-through-log 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

breaking-change Breaking API change

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant