yiguolei commented on code in PR #17820: URL: https://github.com/apache/doris/pull/17820#discussion_r1147308885
########## be/src/vec/common/arena.h: ########## @@ -271,9 +276,17 @@ class Arena : private boost::noncopyable { return res; } + void clear() { + delete head; + head = new Chunk(initial_size, nullptr), size_in_bytes = head->size(), + size_in_allocated = 0; + } + /// Size of chunks in bytes. size_t size() const { return size_in_bytes; } + size_t allocated_size() const { return size_in_allocated + head->remaining(); } Review Comment: pos-start ########## be/src/vec/common/arena.h: ########## @@ -84,10 +84,12 @@ class Arena : private boost::noncopyable { size_t growth_factor; size_t linear_growth_threshold; + size_t initial_size; /// Last contiguous chunk of memory. Chunk* head; size_t size_in_bytes; + size_t size_in_allocated; Review Comment: add comment for this variable. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org For additional commands, e-mail: commits-h...@doris.apache.org