Beispiel #1
0
        public bool TryAppend(ref SendRequestEntry otherEntry)
        {
            var otherEntryLength = otherEntry.RioBufferSegmentDescriptor.Length;

            if (otherEntryLength > _bufferSegmentLength - BatchingEntry->RioBufferSegmentDescriptor.Length)
            {
                return(false);
            }

            var endOfBatchingEntryData  = BatchingEntry->GetBufferSegmentStart() + BatchingEntry->RioBufferSegmentDescriptor.Length;
            var startOfCurrentEntryData = otherEntry.GetBufferSegmentStart();

            Unsafe.CopyBlockUnaligned(endOfBatchingEntryData, startOfCurrentEntryData, (uint)otherEntryLength);
            BatchingEntry->RioBufferSegmentDescriptor.Length += otherEntryLength;
            Size++;
            return(true);
        }
Beispiel #2
0
 public void Initialize(ref SendRequestEntry currentEntry, long sequence)
 {
     BatchingEntry         = (SendRequestEntry *)Unsafe.AsPointer(ref currentEntry);
     BatchingEntrySequence = sequence;
     Size = 1;
 }