Skip to content

[8.8] [MOD-18996] Transfer allocation accounting between allocators - #1117

Closed
github-actions[bot] wants to merge 1 commit into
8.8from
backport-1115-to-8.8
Closed

github-actions[bot] wants to merge 1 commit into
8.8from
backport-1115-to-8.8

Conversation

@github-actions

@github-actions github-actions Bot commented Nov 12, 2026 •

Copy link
Copy Markdown

Description

Backport of #1115 to 8.8.


Note

Medium Risk
Touches per-allocator memory accounting; misuse or concurrent transfer could skew limits or double-free if ownership rules are violated, though behavior is scoped and heavily unit-tested.

Overview
Adds VecSimAllocator::transferAllocationTo, which moves byte accounting for an existing pointer from one allocator to another without calling malloc/free or changing pointer contents or alignment. Null pointers and transfers to the same allocator are no-ops; the header documents that callers must own the allocation exclusively, align deleters with the new allocator, and that the two allocated counters are updated separately (not atomically as a pair.

Unit coverage is added via a new test_allocation_transfer target: balanced accounting across alignments and sizes, null/self and round-trip transfers, and a hook proving transfer does not invoke underlying alloc/free.

Reviewed by Cursor Bugbot for commit 6b8f498. Bugbot is set up for automated code reviews on this repo. Configure here.

@GuyAv46
GuyAv46 marked this pull request as draft November 12, 2026 12:31
@GuyAv46
GuyAv46 marked this pull request as ready for review November 12, 2026 12:31
@GuyAv46
GuyAv46 self-requested a review November 12, 2026 12:31
@codecov

codecov Bot commented Nov 12, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 97.11%. Comparing base (34143cd) to head (6b8f498).

Additional details and impacted files
@@            Coverage Diff             @@
##              8.8    #1117      +/-   ##
==========================================
+ Coverage   97.08%   97.11%   +0.02%     
==========================================
  Files         142      142              
  Lines        8233     8240       +7     
==========================================
+ Hits         7993     8002       +9     
+ Misses        240      238       -2     

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

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