From 9bd68b189ee72564b20f501d0dc9d3c904c035fa Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Sat, 24 Aug 2019 18:31:45 +0200 Subject: [PATCH] KBuffer: capacity() should return internal capacity, not internal size KBuffer is just meant to be a dumb wrapper around KBufferImpl. With this change, we actually start to see KBuffers with different size and capacity, which allows some reallocation-avoiding optimizations. --- Kernel/KBuffer.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Kernel/KBuffer.h b/Kernel/KBuffer.h index 70e56ce3c4..bae0de3483 100644 --- a/Kernel/KBuffer.h +++ b/Kernel/KBuffer.h @@ -68,7 +68,7 @@ public: u8* data() { return m_impl->data(); } const u8* data() const { return m_impl->data(); } size_t size() const { return m_impl->size(); } - size_t capacity() const { return m_impl->size(); } + size_t capacity() const { return m_impl->capacity(); } void set_size(size_t size) { m_impl->set_size(size); }