diff options
author | Henning Baldersheim <balder@yahoo-inc.com> | 2021-02-02 16:19:03 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-02-02 16:19:03 +0100 |
commit | 4c87d180e880012b9ef932c8490a773509cfedd0 (patch) | |
tree | ff993a6ea2bf254e06d6875511aeae533c9b1d8b /fastos/src | |
parent | cc09087f82931a6b00498128f88c30e8d024bd34 (diff) |
Revert "Properly track execution of BucketTasks and provide sync() and order… "
Diffstat (limited to 'fastos/src')
-rw-r--r-- | fastos/src/vespa/fastos/ringbuffer.h | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/fastos/src/vespa/fastos/ringbuffer.h b/fastos/src/vespa/fastos/ringbuffer.h index 89b1bb84c9c..41c0af7385b 100644 --- a/fastos/src/vespa/fastos/ringbuffer.h +++ b/fastos/src/vespa/fastos/ringbuffer.h @@ -42,6 +42,18 @@ public: _closed = false; } + FastOS_RingBufferData *GetData () { return _data; } + + void RepositionDataAt0 () + { + uint8_t *src = &_data->_buffer[_dataIndex]; + uint8_t *dst = _data->_buffer; + + for(int i=0; i<_dataSize; i++) + *dst++ = *src++; + _dataIndex = 0; + } + FastOS_RingBuffer (int bufferSize) : _closed(false), _data(0), @@ -81,6 +93,11 @@ public: _dataSize += bytes; } + int GetDataSize () + { + return _dataSize; + } + int GetWriteSpace () { int spaceLeft = _bufferSize - _dataSize; |