New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Adding UnpaddedAtomic queues #388
Conversation
@jponge ;) |
final int offsetInOld = modifiedCalcCircularRefElementOffset(pIndex, oldMask); | ||
final int offsetInNew = modifiedCalcCircularRefElementOffset(pIndex, newMask); | ||
// element in new array | ||
soRefElement(newBuffer, offsetInNew, e == null ? s.get() : e); |
Check warning
Code scanning / CodeQL
Dereferenced variable may be null Warning
s
this
Variable
s
this
Variable
s
this
I see now that I have created the queues under unpadded.atomic instead of atomic.unpadded, likely because I've decided for names like UnpaddedAtomicArrayQueue, because I love to keep AtomicQueue together, but if you prefer differently, I can do it; i really have no strong preferences on this |
@nitsanw If you prefer |
There's already an unpadded code generator, I think it would be better to enhance it rather than add code to all the different atomic queue generators. |
In term of code changes, and complexity, I found much easier to modify the atomic generators, given that the most of the work is there, while unpadding (from unsafe versions) seems a relatively easier job (mostly removing comments and unpadded fields). |
I think it makes sense to put the unpadding into one place, I gave it a few minutes and it seems doable, but if you think it's not I don't mind that much. |
Ok @nitsanw i will give it a shot and see where I go, I would have avoided to copy parts/refactor atomic generator into the existing unpadded one |
Fixes #387
@nitsanw I didn't tried yet to reuse some unpadded gen code, but the most of the work should be done, if the naming is fine for you.