util/CircularBuffer: use std::span internally
This commit is contained in:
@@ -20,7 +20,6 @@ AsyncInputStream::AsyncInputStream(EventLoop &event_loop, std::string_view _url,
|
||||
deferred_resume(event_loop, BIND_THIS_METHOD(DeferredResume)),
|
||||
deferred_seek(event_loop, BIND_THIS_METHOD(DeferredSeek)),
|
||||
allocation(_buffer_size),
|
||||
buffer(&allocation.front(), allocation.size()),
|
||||
resume_at(_resume_at)
|
||||
{
|
||||
allocation.SetName("InputStream");
|
||||
|
||||
@@ -23,7 +23,7 @@ class AsyncInputStream : public InputStream {
|
||||
|
||||
HugeArray<std::byte> allocation;
|
||||
|
||||
CircularBuffer<std::byte> buffer;
|
||||
CircularBuffer<std::byte> buffer{allocation};
|
||||
const size_t resume_at;
|
||||
|
||||
enum class SeekState : uint_least8_t {
|
||||
|
||||
@@ -16,8 +16,7 @@ ThreadInputStream::ThreadInputStream(const char *_plugin,
|
||||
:InputStream(_uri, _mutex),
|
||||
plugin(_plugin),
|
||||
thread(BIND_THIS_METHOD(ThreadFunc)),
|
||||
allocation(_buffer_size),
|
||||
buffer(&allocation.front(), allocation.size())
|
||||
allocation(_buffer_size)
|
||||
{
|
||||
allocation.SetName("InputStream");
|
||||
allocation.ForkCow(false);
|
||||
|
||||
@@ -43,7 +43,7 @@ class ThreadInputStream : public InputStream {
|
||||
|
||||
HugeArray<std::byte> allocation;
|
||||
|
||||
CircularBuffer<std::byte> buffer;
|
||||
CircularBuffer<std::byte> buffer{allocation};
|
||||
|
||||
/**
|
||||
* Shall the stream be closed?
|
||||
|
||||
Reference in New Issue
Block a user