1.1 --- a/files/pipe_paging.cc Wed Mar 24 23:44:53 2021 +0100
1.2 +++ b/files/pipe_paging.cc Thu Mar 25 01:42:50 2021 +0100
1.3 @@ -1,6 +1,7 @@
1.4 #include "pipe_paging.h"
1.5
1.6 -PipePaging::PipePaging()
1.7 +PipePaging::PipePaging(offset_t size)
1.8 +: _size(size)
1.9 {
1.10 }
1.11
1.12 @@ -25,6 +26,11 @@
1.13 {
1.14 if (_regions.size() > 1)
1.15 {
1.16 + /* Discard the accessor from the current region. */
1.17 +
1.18 + if (_accessors.size() > _regions.size())
1.19 + _accessors.pop_front();
1.20 +
1.21 _regions.pop_front();
1.22 return _regions.front();
1.23 }
1.24 @@ -32,4 +38,14 @@
1.25 return NULL;
1.26 }
1.27
1.28 +/* Initialise an accessor for a region. */
1.29 +
1.30 +PipeAccessor *PipePaging::accessor()
1.31 +{
1.32 + PipeAccessor accessor;
1.33 +
1.34 + _accessors.push_back(accessor);
1.35 + return &_accessors.back();
1.36 +}
1.37 +
1.38 // vim: tabstop=4 expandtab shiftwidth=4