Skip to content

[vulkan] remove unused allocator release overload#9238

Open
johningve wants to merge 1 commit into
halide:mainfrom
johningve:remove-unused-vulkan-allocator-release
Open

[vulkan] remove unused allocator release overload#9238
johningve wants to merge 1 commit 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 70.33%. Comparing base (055bc89) to head (7273c2b).
⚠️ Report is 6 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #9238      +/-   ##
==========================================
+ Coverage   70.24%   70.33%   +0.09%     
==========================================
  Files         255      255              
  Lines       78929    78904      -25     
  Branches    18879    18866      -13     
==========================================
+ Hits        55444    55498      +54     
+ Misses      17872    17857      -15     
+ Partials     5613     5549      -64     

☔ 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.

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