[enhancement] Refactor to improve the usability of MemTracker (step2) (#10823)

This commit is contained in:
Xinyi Zou
2022-07-21 17:11:28 +08:00
committed by GitHub
parent 5f6f35e886
commit 4960043f5e
316 changed files with 2145 additions and 4369 deletions

View File

@ -22,7 +22,6 @@
#include "olap/tablet_schema.h"
#include "olap/types.h"
#include "runtime/mem_tracker.h"
#include "runtime/string_value.h"
#include "testutil/array_utils.h"
@ -52,8 +51,7 @@ static TypeInfoPtr get_type_info(const ColumnPB& column_pb) {
static void test_array_parser(const ColumnPB& column_pb, const std::string& json,
const CollectionValue& expect) {
MemTracker tracker(1024 * 1024, "ArrayParserTest");
MemPool mem_pool(&tracker);
MemPool mem_pool;
FunctionContext context;
ArrayUtils::prepare_context(context, mem_pool, column_pb);
CollectionValue actual;
@ -175,8 +173,7 @@ TEST(ArrayParserTest, TestDecimalArray) {
TEST(ArrayParserTest, TestFreePool) {
auto column_pb = create_column_pb("ARRAY", "DECIMAL");
MemTracker tracker(1024 * 1024, "ArrayParserTest");
MemPool mem_pool(&tracker);
MemPool mem_pool;
FunctionContext context;
ArrayUtils::prepare_context(context, mem_pool, column_pb);
int alignment = 1;