1.1 --- a/libmem/lib/src/flexpage.cc Sat May 01 23:51:28 2021 +0200
1.2 +++ b/libmem/lib/src/flexpage.cc Sat May 01 23:51:50 2021 +0200
1.3 @@ -61,6 +61,9 @@
1.4 page_addr = base_addr + page_offset;
1.5 }
1.6
1.7 +/* Decrement the usage counter, returning whether the flexpage is now no longer
1.8 + used. */
1.9 +
1.10 bool Flexpage::decrement()
1.11 {
1.12 if (_counter)
1.13 @@ -72,16 +75,22 @@
1.14 return 0;
1.15 }
1.16
1.17 +/* Increment the usage counter. */
1.18 +
1.19 void Flexpage::increment()
1.20 {
1.21 _counter++;
1.22 }
1.23
1.24 +/* Invalidate the flexpage, meaning that it should not now be in use. */
1.25 +
1.26 void Flexpage::invalidate()
1.27 {
1.28 _counter = 0;
1.29 }
1.30
1.31 +/* Return whether the flexpage is in use and is therefore valid. */
1.32 +
1.33 bool Flexpage::valid()
1.34 {
1.35 return _counter != 0;