Skip to content

Make StatsCache and ArrayAndStats have interior mutability#7583

Merged
connortsui20 merged 1 commit intodevelopfrom
ct/compress-array-and-stats
Apr 21, 2026
Merged

Make StatsCache and ArrayAndStats have interior mutability#7583
connortsui20 merged 1 commit intodevelopfrom
ct/compress-array-and-stats

Conversation

@connortsui20
Copy link
Copy Markdown
Contributor

Summary

Tracking issue: #7216

It was unfortunate that ArrayAndStats had to be taken by &mut, so this change makes updates use interior mutability.

API Changes

Scheme takes ArrayAndStats by shared reference instead of by exclusive reference.

Testing

N/A since there isn't any semantic change here, just API changes.

Signed-off-by: Connor Tsui <connor.tsui20@gmail.com>
@connortsui20 connortsui20 added the changelog/break A breaking API change label Apr 21, 2026
@connortsui20 connortsui20 enabled auto-merge (squash) April 21, 2026 15:01
@connortsui20 connortsui20 merged commit 3e00b5a into develop Apr 21, 2026
62 of 64 checks passed
@connortsui20 connortsui20 deleted the ct/compress-array-and-stats branch April 21, 2026 15:05
@a10y
Copy link
Copy Markdown
Contributor

a10y commented Apr 21, 2026

Wait, why is this better? isn't it preferable to not have extra unnecessary locking?

@connortsui20
Copy link
Copy Markdown
Contributor Author

@a10y The fastpath on the mutex will basically never lock because the compressor only runs single-threaded, the only reason is to keep this Sync.

@a10y
Copy link
Copy Markdown
Contributor

a10y commented Apr 21, 2026

I don't think this affects the Sendness of the compressor schemes?

@connortsui20
Copy link
Copy Markdown
Contributor Author

Sorry, to keep the array and stats sync

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

changelog/break A breaking API change

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants