Skip to content

[vulkan] remove unused allocator release overload - #9238

Merged
alexreinking merged 2 commits into
halide:mainfrom
johningve:remove-unused-vulkan-allocator-release
Aug 9, 2026
Merged

[vulkan] remove unused allocator release overload#9238
alexreinking merged 2 commits into
halide:mainfrom
johningve:remove-unused-vulkan-allocator-release

Conversation

@johningve

Copy link
Copy Markdown
Contributor

The Vulkan allocator as well as the region and block allocators all had a int release(void *user_context) overload in addition to the regular int release(void *user_context, MemoryRegion *region). The single-argument overload is unused, and it is bug prone. It is easy to call the single-argument overload instead of the correct two-argument overload by forgetting to fill the user_context argument. This may not produce any compiler error because a pointer to a MemoryRegion converts implicitly to a void *.

Since the overload is unused, this commit removes it from the three allocator classes. Also in the block allocator, a private helper release_block_entry is also removed. Its only reference was the single-argument release.

Checklist

  • Tests added or updated (not required for docs, CI config, or typo fixes)
  • Documentation updated (if public API changed)
  • Python bindings updated (if public API changed)
  • Benchmarks are included here if the change is intended to affect performance.
  • Commits include AI attribution where applicable (see Code of Conduct)

The Vulkan allocator as well as the region and block allocators all had
a `int release(void *user_context)` overload in addition to the regular
`int release(void *user_context, MemoryRegion *region)`. The
single-argument overload is unused, and it is bug prone. It is easy to
call the single-argument overload instead of the correct two-argument
overload by forgetting to fill the user_context argument. This may not
produce any compiler error because a pointer to a MemoryRegion converts
implicitly to a `void *`.

Since the overload is unused, this commit removes it from the three
allocator classes. Also in the block allocator, a private helper
`release_block_entry` is also removed. Its only reference was the
single-argument `release`.
@alexreinking alexreinking added the code_cleanup No functional changes. Reformatting, reorganizing, or refactoring existing code. label Jul 24, 2026
@codecov

codecov Bot commented Jul 24, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 69.96%. Comparing base (8e645d2) to head (1e7c20e).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #9238      +/-   ##
==========================================
- Coverage   69.96%   69.96%   -0.01%     
==========================================
  Files         258      258              
  Lines       77927    77927              
  Branches    18974    18974              
==========================================
- Hits        54524    54521       -3     
+ Misses      17771    17759      -12     
- Partials     5632     5647      +15     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

…allocator-release

# Conflicts:
#	src/runtime/internal/region_allocator.h
@alexreinking
alexreinking merged commit a09c52d into halide:main Aug 9, 2026
25 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

code_cleanup No functional changes. Reformatting, reorganizing, or refactoring existing code.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants