correct the owner tenant of Compressor memory

This commit is contained in:
tushicheng
2023-06-01 11:47:30 +00:00
committed by ob-robot
parent e63e1eb45e
commit 531f15a648
4 changed files with 10 additions and 8 deletions

View File

@ -41,8 +41,9 @@ static void ob_zstd_free(void *opaque, void *address)
/** /**
* ------------------------------ObZstdCtxAllocator--------------------- * ------------------------------ObZstdCtxAllocator---------------------
*/ */
ObZstdCtxAllocator::ObZstdCtxAllocator() ObZstdCtxAllocator::ObZstdCtxAllocator(int64_t tenant_id)
: allocator_(ObModIds::OB_COMPRESSOR, OB_MALLOC_BIG_BLOCK_SIZE) : allocator_(ObModIds::OB_COMPRESSOR, OB_MALLOC_BIG_BLOCK_SIZE,
tenant_id)
{ {
} }

View File

@ -26,11 +26,11 @@ namespace zstd
class ObZstdCtxAllocator class ObZstdCtxAllocator
{ {
public: public:
ObZstdCtxAllocator(); ObZstdCtxAllocator(int64_t tenant_id);
virtual ~ObZstdCtxAllocator(); virtual ~ObZstdCtxAllocator();
static ObZstdCtxAllocator &get_thread_local_instance() static ObZstdCtxAllocator &get_thread_local_instance()
{ {
thread_local ObZstdCtxAllocator allocator; thread_local ObZstdCtxAllocator allocator(ob_thread_tenant_id());
return allocator; return allocator;
} }
void *alloc(size_t size); void *alloc(size_t size);

View File

@ -42,8 +42,9 @@ static void ob_zstd_free(void *opaque, void *address)
/** /**
* ------------------------------ObZstdCtxAllocator--------------------- * ------------------------------ObZstdCtxAllocator---------------------
*/ */
ObZstdCtxAllocator::ObZstdCtxAllocator() ObZstdCtxAllocator::ObZstdCtxAllocator(int64_t tenant_id)
: allocator_(ObModIds::OB_COMPRESSOR, OB_MALLOC_BIG_BLOCK_SIZE) : allocator_(ObModIds::OB_COMPRESSOR, OB_MALLOC_BIG_BLOCK_SIZE,
tenant_id)
{ {
} }

View File

@ -26,11 +26,11 @@ namespace zstd_1_3_8
class ObZstdCtxAllocator class ObZstdCtxAllocator
{ {
public: public:
ObZstdCtxAllocator(); ObZstdCtxAllocator(int64_t tenant_id);
virtual ~ObZstdCtxAllocator(); virtual ~ObZstdCtxAllocator();
static ObZstdCtxAllocator &get_thread_local_instance() static ObZstdCtxAllocator &get_thread_local_instance()
{ {
thread_local ObZstdCtxAllocator allocator; thread_local ObZstdCtxAllocator allocator(ob_thread_tenant_id());
return allocator; return allocator;
} }
void *alloc(size_t size); void *alloc(size_t size);