Skip to content

Add a generic leak detector - #3800

Draft
IntegratedQuantum wants to merge 2 commits into
PixelGuys:masterfrom
IntegratedQuantum:vulkan_leak_detector
Draft

IntegratedQuantum wants to merge 2 commits into
PixelGuys:masterfrom
IntegratedQuantum:vulkan_leak_detector

Conversation

@IntegratedQuantum

@IntegratedQuantum IntegratedQuantum commented Nov 15, 2026 •

Copy link
Copy Markdown
Member

fixes #3075

  • vulkan images
  • pipelines
  • vulkan buffers
  • LargeBuffers
  • Memory Pools
  • stack allocator
  • measure if this has a notable performance impact
  • print trace on alloc before free (TODO in the code)
  • Better error on free of invalid item
  • Command buffers

@Wunka Wunka left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I know this is a draft, but just wanted to note that, as it is not in your todo list.

Comment thread src/utils/leak.zig

pub fn freeAllocation(identifier: Identifier) void {
if (!builtin.mode.runtimeSafety()) return;
std.debug.assert(allocationHashMap.remove(identifier));

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would probably print a better error here if the assert is not true.
Because if it's false, we know that it is either a double free or a free before alloc.

This branch has not been deployed

No deployments
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.

Generic leak checking for all allocators, and allocator-like data structures

2 participants