Add reserve to ResizableBuffer
Change-Id: I4aab1652ad342af543dba586cba2b9cf3f415ac6
Signed-off-by: Austin Schuh <austin.linux@gmail.com>
diff --git a/aos/containers/resizeable_buffer.h b/aos/containers/resizeable_buffer.h
index 5eb955f..4a4038c 100644
--- a/aos/containers/resizeable_buffer.h
+++ b/aos/containers/resizeable_buffer.h
@@ -42,6 +42,12 @@
size_t size() const { return size_; }
size_t capacity() const { return capacity_; }
+ void reserve(size_t new_size) {
+ if (new_size > capacity_) {
+ Allocate(new_size);
+ }
+ }
+
void resize(size_t new_size) {
if (new_size > capacity_) {
Allocate(new_size);