From 52d92104007dd05f2e92f9081c9c234b7c9f69c9 Mon Sep 17 00:00:00 2001 From: King_DuckZ Date: Fri, 12 Feb 2021 14:19:55 +0100 Subject: [PATCH] Include vector size in mem usage count --- src/dynafunc_maker.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/dynafunc_maker.cpp b/src/dynafunc_maker.cpp index 2440a8f..b43f6ce 100644 --- a/src/dynafunc_maker.cpp +++ b/src/dynafunc_maker.cpp @@ -101,7 +101,9 @@ namespace wren { } std::size_t DynafuncMaker::total_memory() const { - return m_pages.size() * m_page_size; + return m_pages.size() * m_page_size + + m_pages.capacity() * sizeof(decltype(m_pages)::value_type) + + 0; } unsigned char* DynafuncMaker::allocate_chunk() {