Skip to content

v4.4: vote_reward.rs: avoids calloc when creating new AccountSharedData (backport of #16101) - #16104

Merged
bw-solana merged 1 commit into
v4.4from
mergify/bp/v4.4/pr-16101
Oct 15, 2026
Merged

bw-solana merged 1 commit into
v4.4from
mergify/bp/v4.4/pr-16101

Conversation

@mergify

@mergify mergify Bot commented Oct 15, 2026

Copy link
Copy Markdown

Problem

Currently when we create a AccountSharedData for when we update the VoteAccount, we are using calloc for creating the storage for the data. calloc bypasses the memory allocator which messes up our jemalloc tracking.

Summary of Changes

This change first creates an empty Vec for the data and then resizes it so that we are using realloc instead. This should now go through the memory allocator.

Testing

No new tests added


This is an automatic backport of pull request #16101 done by [Mergify](https://mergify.com).

@mergify
mergify Bot requested a review from a team as a code owner October 15, 2026 19:21
@akhi3030
akhi3030 requested a review from AshwinSekar October 15, 2026 19:22

@AshwinSekar AshwinSekar left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

approving as SME

@codecov-commenter

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 82.4%. Comparing base (709a68f) to head (01d230e).

Additional details and impacted files
@@           Coverage Diff           @@
##             v4.4   #16104   +/-   ##
=======================================
  Coverage    82.4%    82.4%           
=======================================
  Files         934      934           
  Lines      372233   372233           
=======================================
+ Hits       306882   306932   +50     
+ Misses      65351    65301   -50     
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@bw-solana
bw-solana merged commit c60e71f into v4.4 Oct 15, 2026
46 checks passed
@bw-solana
bw-solana deleted the mergify/bp/v4.4/pr-16101 branch October 15, 2026 20:59
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.

4 participants