Skip to content

chore: minimal complexity reduction in unsafe replacement#1678

Merged
derklaro merged 4 commits into
nightlyfrom
ur-cas-reduce-complexity
Jul 20, 2025
Merged

chore: minimal complexity reduction in unsafe replacement#1678
derklaro merged 4 commits into
nightlyfrom
ur-cas-reduce-complexity

Conversation

@derklaro

@derklaro derklaro commented Jul 1, 2025

Copy link
Copy Markdown
Member

Motivation

Some complexity in CAS operations can be reduced. Additionally the ByteBuffer cleaning MethodHandle can be reduced to a single one instead of having to call multiple manually.

Modification

Use compareAndSet from VarHandle instead of compareAndExchange as it doesn't require the manual equality check. The ByteBuffer cleaning MethodHandle is now compacted into a single one which does all the current manual steps.

Result

A bit less complexity in unsafe replacement.

@derklaro derklaro added this to the 4.0.0-RC14 milestone Jul 1, 2025
@derklaro derklaro requested a review from 0utplay July 1, 2025 07:57
@derklaro derklaro self-assigned this Jul 1, 2025
@derklaro derklaro added v: 4.X This pull should be included in the 4.0 release t: improvement The pull request improves existing code in: wrapper An issue/pull request releated to the wrapper module code labels Jul 1, 2025
@github-actions

github-actions Bot commented Jul 1, 2025

Copy link
Copy Markdown

Test Results

 56 files  ±0   56 suites  ±0   2m 32s ⏱️ -11s
570 tests ±0  570 ✅ ±0  0 💤 ±0  0 ❌ ±0 
935 runs  ±0  935 ✅ ±0  0 💤 ±0  0 ❌ ±0 

Results for commit a8068a0. ± Comparison against base commit a358f99.

♻️ This comment has been updated with latest results.

0utplay
0utplay previously approved these changes Jul 2, 2025
@derklaro derklaro merged commit ad95175 into nightly Jul 20, 2025
5 checks passed
@derklaro derklaro deleted the ur-cas-reduce-complexity branch July 20, 2025 10:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

in: wrapper An issue/pull request releated to the wrapper module code t: improvement The pull request improves existing code v: 4.X This pull should be included in the 4.0 release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants