Skip to content
This repository has been archived by the owner on Aug 16, 2023. It is now read-only.

ByteBufferBytes must set bb's order to native in constructor #24

Closed
leventov opened this issue Feb 17, 2014 · 1 comment
Closed

ByteBufferBytes must set bb's order to native in constructor #24

leventov opened this issue Feb 17, 2014 · 1 comment

Comments

@leventov
Copy link
Contributor

Because compare-and-swap operations end up with native ops.

Breaking test:

    @Test
    public void testCAS() {
        Bytes bytes = new ByteBufferBytes(ByteBuffer.allocate(100));
        bytes.compareAndSwapLong(0, 0L, 1L);
        assertEquals(1L, bytes.readLong(0));
    }
@peter-lawrey
Copy link
Member

Java lang's general handling of byte order is broken unfortunately. Only
native order is really handled. This should be fixed.
On 17 Feb 2014 00:50, "Roman Leventov" [email protected] wrote:

Because compare-and-swap operations end up with native ops.

Breaking test:

@Test
public void testCAS() {
    Bytes bytes = new ByteBufferBytes(ByteBuffer.allocate(100));
    bytes.compareAndSwapLong(0, 0L, 1L);
    assertEquals(1L, bytes.readLong(0));
}

Reply to this email directly or view it on GitHubhttps://github.com//issues/24
.

peter-lawrey added a commit that referenced this issue Feb 19, 2014
Finished with ATSDirectBitSet; Fixed #24
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants