diff --git a/src/storage/blocksstable/encoding/ob_encoding_hash_util.cpp b/src/storage/blocksstable/encoding/ob_encoding_hash_util.cpp index 7cccf0dd3d..18c1a596e5 100644 --- a/src/storage/blocksstable/encoding/ob_encoding_hash_util.cpp +++ b/src/storage/blocksstable/encoding/ob_encoding_hash_util.cpp @@ -25,7 +25,7 @@ using namespace common; ObEncodingHashTable::ObEncodingHashTable() : is_created_(false), bucket_num_(0), node_num_(0), list_num_(0), node_cnt_(0), list_cnt_(0), buckets_(NULL), nodes_(NULL), - lists_(NULL), alloc_(blocksstable::OB_ENCODING_LABEL_HASH_TABLE) + lists_(NULL), alloc_(blocksstable::OB_ENCODING_LABEL_HASH_TABLE, OB_MALLOC_NORMAL_BLOCK_SIZE, MTL_ID()) { MEMSET(&null_nodes_, 0, sizeof(null_nodes_)); MEMSET(&nope_nodes_, 0, sizeof(nope_nodes_)); @@ -226,6 +226,8 @@ ObEncodingHashTableFactory::ObEncodingHashTableFactory() : allocator_(OB_MALLOC_NORMAL_BLOCK_SIZE, ObMalloc(blocksstable::OB_ENCODING_LABEL_HT_FACTORY)), hashtables_() { + lib::ObMemAttr attr(MTL_ID(), blocksstable::OB_ENCODING_LABEL_HT_FACTORY); + allocator_.set_attr(attr); } ObEncodingHashTableFactory::~ObEncodingHashTableFactory() diff --git a/src/storage/blocksstable/encoding/ob_encoding_util.h b/src/storage/blocksstable/encoding/ob_encoding_util.h index dc81881434..9ab670f2c8 100644 --- a/src/storage/blocksstable/encoding/ob_encoding_util.h +++ b/src/storage/blocksstable/encoding/ob_encoding_util.h @@ -18,6 +18,7 @@ #include "common/object/ob_object.h" #include "common/ob_action_flag.h" #include "storage/blocksstable/ob_datum_row.h" +#include "share/rc/ob_tenant_base.h" namespace oceanbase { @@ -603,8 +604,7 @@ private: ret = common::OB_SIZE_OVERFLOW; STORAGE_LOG(WARN, "size will overflow", K(ret), K_(size), K(block_cnt), K(cur_cnt)); } else { - common::ObMemAttr ma; - ma.label_ = blocksstable::OB_ENCODING_LABEL_PIVOT; + common::ObMemAttr ma(MTL_ID(), blocksstable::OB_ENCODING_LABEL_PIVOT); for (int64_t i = 0; i < block_cnt && OB_SUCC(ret); ++i) { if (NULL == block_list_[cur_cnt + i]) { T *block = static_cast(common::ob_malloc(BLOCK_SIZE, ma)); diff --git a/src/storage/blocksstable/encoding/ob_micro_block_encoder.cpp b/src/storage/blocksstable/encoding/ob_micro_block_encoder.cpp index 884abab73f..2bb99d6b9a 100644 --- a/src/storage/blocksstable/encoding/ob_micro_block_encoder.cpp +++ b/src/storage/blocksstable/encoding/ob_micro_block_encoder.cpp @@ -306,14 +306,15 @@ int ObMicroBlockEncoder::init_all_col_values(const ObMicroBlockEncodingCtx &ctx) if (OB_FAIL(all_col_datums_.reserve(ctx.column_cnt_))) { LOG_WARN("reserve array failed", K(ret), "size", ctx.column_cnt_); } + lib::ObMemAttr attr(MTL_ID(), blocksstable::OB_ENCODING_LABEL_PIVOT); for (int64_t i = all_col_datums_.count(); i < ctx.column_cnt_ && OB_SUCC(ret); ++i) { - ObColDatums *c = OB_NEW(ObColDatums, blocksstable::OB_ENCODING_LABEL_PIVOT); + ObColDatums *c = OB_NEW(ObColDatums, attr); if (OB_ISNULL(c)) { ret = OB_ALLOCATE_MEMORY_FAILED; LOG_WARN("alloc memory failed", K(ret), K(ctx)); } else if (OB_FAIL(all_col_datums_.push_back(c))) { LOG_WARN("push back column values failed", K(ret)); - OB_DELETE(ObColDatums, blocksstable::OB_ENCODING_LABEL_PIVOT, c); + OB_DELETE(ObColDatums, attr, c); } } return ret; diff --git a/src/storage/blocksstable/encoding/ob_multi_prefix_tree.cpp b/src/storage/blocksstable/encoding/ob_multi_prefix_tree.cpp index 632f0d4e85..b9ce06bc59 100644 --- a/src/storage/blocksstable/encoding/ob_multi_prefix_tree.cpp +++ b/src/storage/blocksstable/encoding/ob_multi_prefix_tree.cpp @@ -123,7 +123,7 @@ int ObMultiPrefixTree::HashTable::build(TreeNode &tnode, const int64_t move_step * ObMultiPrefixTree */ ObMultiPrefixTree::ObMultiPrefixTree() : is_inited_(false), - alloc_(blocksstable::OB_ENCODING_LABEL_MULTI_PREFIX_TREE), + alloc_(blocksstable::OB_ENCODING_LABEL_MULTI_PREFIX_TREE, OB_MALLOC_NORMAL_BLOCK_SIZE, MTL_ID()), tree_nodes_(NULL), cell_nodes_(NULL), tnode_cnt_(0), cnode_cnt_(0), cnode_cnt_limit_(0), ht_(), null_cnt_(0), nope_cnt_(0) @@ -458,6 +458,8 @@ ObMultiPrefixTreeFactory::ObMultiPrefixTreeFactory() : allocator_(OB_MALLOC_NORMAL_BLOCK_SIZE, ObMalloc(blocksstable::OB_ENCODING_LABEL_PREFIX_TREE_FACTORY)), prefix_trees_() { + lib::ObMemAttr attr(MTL_ID(), blocksstable::OB_ENCODING_LABEL_PREFIX_TREE_FACTORY); + allocator_.set_attr(attr); } ObMultiPrefixTreeFactory::~ObMultiPrefixTreeFactory() diff --git a/src/storage/blocksstable/encoding/ob_string_diff_encoder.cpp b/src/storage/blocksstable/encoding/ob_string_diff_encoder.cpp index ce325c7436..bb5f756e6f 100644 --- a/src/storage/blocksstable/encoding/ob_string_diff_encoder.cpp +++ b/src/storage/blocksstable/encoding/ob_string_diff_encoder.cpp @@ -32,7 +32,7 @@ ObStringDiffEncoder::ObStringDiffEncoder() : string_size_(0), common_size_(0), row_store_size_(0), null_cnt_(0), nope_cnt_(0), first_string_(NULL), header_(NULL), last_change_diff_row_id_(0), - allocator_(blocksstable::OB_ENCODING_LABEL_STRING_DIFF) + allocator_(blocksstable::OB_ENCODING_LABEL_STRING_DIFF, OB_MALLOC_NORMAL_BLOCK_SIZE, MTL_ID()) { }