util/SliceBuffer: add "noexcept"
This commit is contained in:
@@ -66,7 +66,7 @@ public:
|
|||||||
buffer.ForkCow(false);
|
buffer.ForkCow(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
~SliceBuffer() {
|
~SliceBuffer() noexcept {
|
||||||
/* all slices must be freed explicitly, and this
|
/* all slices must be freed explicitly, and this
|
||||||
assertion checks for leaks */
|
assertion checks for leaks */
|
||||||
assert(n_allocated == 0);
|
assert(n_allocated == 0);
|
||||||
@@ -75,15 +75,15 @@ public:
|
|||||||
SliceBuffer(const SliceBuffer &other) = delete;
|
SliceBuffer(const SliceBuffer &other) = delete;
|
||||||
SliceBuffer &operator=(const SliceBuffer &other) = delete;
|
SliceBuffer &operator=(const SliceBuffer &other) = delete;
|
||||||
|
|
||||||
unsigned GetCapacity() const {
|
unsigned GetCapacity() const noexcept {
|
||||||
return buffer.size();
|
return buffer.size();
|
||||||
}
|
}
|
||||||
|
|
||||||
bool empty() const {
|
bool empty() const noexcept {
|
||||||
return n_allocated == 0;
|
return n_allocated == 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool IsFull() const {
|
bool IsFull() const noexcept {
|
||||||
return n_allocated == buffer.size();
|
return n_allocated == buffer.size();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -112,7 +112,7 @@ public:
|
|||||||
return ::new((void *)value) T(std::forward<Args>(args)...);
|
return ::new((void *)value) T(std::forward<Args>(args)...);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Free(T *value) {
|
void Free(T *value) noexcept {
|
||||||
assert(n_initialized <= buffer.size());
|
assert(n_initialized <= buffer.size());
|
||||||
assert(n_allocated > 0);
|
assert(n_allocated > 0);
|
||||||
assert(n_allocated <= n_initialized);
|
assert(n_allocated <= n_initialized);
|
||||||
|
Reference in New Issue
Block a user