Skip to content

Commit

Permalink
Add ExpandableArrayBuffer. Closes #95
Browse files Browse the repository at this point in the history
  • Loading branch information
JPWatson committed Aug 7, 2022
1 parent 000f58e commit ea2580a
Show file tree
Hide file tree
Showing 4 changed files with 617 additions and 142 deletions.
16 changes: 4 additions & 12 deletions src/Adaptive.Agrona/Concurrent/UnsafeBuffer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -455,16 +455,6 @@ public void PutInt(int index, int value)
*(int*) (_pBuffer + index) = value;
}

public int PutIntAscii(int index, int value)
{
throw new NotImplementedException();
}

public int PutLongAscii(int index, long value)
{
throw new NotImplementedException();
}

[MethodImpl(MethodImplOptions.AggressiveInlining)]
public int GetIntVolatile(int index)
{
Expand Down Expand Up @@ -597,8 +587,9 @@ public short GetShort(int index)
public short GetShort(int index, ByteOrder byteOrder)
{
BoundsCheck0(index, BitUtil.SIZE_OF_SHORT);

return *(short*) (_pBuffer + index);

var value = *(short*)(_pBuffer + index);
return EndianessConverter.ApplyInt16(byteOrder, value);
}

[MethodImpl(MethodImplOptions.AggressiveInlining)]
Expand All @@ -614,6 +605,7 @@ public void PutShort(int index, short value, ByteOrder byteOrder)
{
BoundsCheck0(index, BitUtil.SIZE_OF_SHORT);

value = EndianessConverter.ApplyInt16(byteOrder, value);
*(short*) (_pBuffer + index) = value;
}

Expand Down
Loading

0 comments on commit ea2580a

Please sign in to comment.