Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Metz
oceanbase
提交
9007c77b
O
oceanbase
项目概览
Metz
/
oceanbase
与 Fork 源项目一致
Fork自
oceanbase / oceanbase
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
O
oceanbase
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
提交
9007c77b
编写于
2月 10, 2022
作者:
N
nroskill
提交者:
LINGuanRen
2月 10, 2022
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
disable construct of ObIAllocator
上级
17b0f303
变更
15
显示空白变更内容
内联
并排
Showing
15 changed file
with
92 addition
and
50 deletion
+92
-50
deps/oblib/src/common/data_buffer.h
deps/oblib/src/common/data_buffer.h
+4
-4
deps/oblib/src/lib/alloc/ob_tenant_ctx_allocator.h
deps/oblib/src/lib/alloc/ob_tenant_ctx_allocator.h
+2
-0
deps/oblib/src/lib/allocator/ob_allocator.h
deps/oblib/src/lib/allocator/ob_allocator.h
+5
-26
deps/oblib/src/lib/allocator/ob_allocator_v2.h
deps/oblib/src/lib/allocator/ob_allocator_v2.h
+4
-2
deps/oblib/src/lib/allocator/ob_fifo_allocator.h
deps/oblib/src/lib/allocator/ob_fifo_allocator.h
+1
-1
deps/oblib/src/lib/allocator/ob_malloc.h
deps/oblib/src/lib/allocator/ob_malloc.h
+6
-6
deps/oblib/src/lib/container/ob_se_array.h
deps/oblib/src/lib/container/ob_se_array.h
+14
-0
src/election/ob_election_msg.h
src/election/ob_election_msg.h
+1
-1
src/liboblog/src/ob_small_arena.h
src/liboblog/src/ob_small_arena.h
+6
-2
src/share/schema/ob_schema_struct.h
src/share/schema/ob_schema_struct.h
+6
-2
src/sql/engine/expr/ob_expr.h
src/sql/engine/expr/ob_expr.h
+9
-0
src/sql/engine/expr/ob_expr_regexp_context.h
src/sql/engine/expr/ob_expr_regexp_context.h
+9
-0
src/sql/plan_cache/ob_id_manager_allocator.h
src/sql/plan_cache/ob_id_manager_allocator.h
+7
-2
src/storage/memtable/ob_memtable_context.h
src/storage/memtable/ob_memtable_context.h
+14
-4
unittest/sql/engine/basic/test_ra_row_store_projector.cpp
unittest/sql/engine/basic/test_ra_row_store_projector.cpp
+4
-0
未找到文件。
deps/oblib/src/common/data_buffer.h
浏览文件 @
9007c77b
...
@@ -28,7 +28,7 @@ public:
...
@@ -28,7 +28,7 @@ public:
ObDataBuffer
(
char
*
data
,
const
int64_t
capacity
)
:
data_
(
data
),
capacity_
(
capacity
),
position_
(
0
),
limit_
(
0
)
ObDataBuffer
(
char
*
data
,
const
int64_t
capacity
)
:
data_
(
data
),
capacity_
(
capacity
),
position_
(
0
),
limit_
(
0
)
{}
{}
~
ObDataBuffer
()
virtual
~
ObDataBuffer
()
{}
{}
inline
bool
set_data
(
char
*
data
,
const
int64_t
capacity
)
inline
bool
set_data
(
char
*
data
,
const
int64_t
capacity
)
...
@@ -55,7 +55,7 @@ public:
...
@@ -55,7 +55,7 @@ public:
limit_
=
0
;
limit_
=
0
;
}
}
inline
void
*
alloc
(
const
int64_t
sz
)
inline
v
irtual
v
oid
*
alloc
(
const
int64_t
sz
)
{
{
void
*
ret
=
NULL
;
void
*
ret
=
NULL
;
if
(
OB_LIKELY
(
sz
>
0
&&
capacity_
-
position_
>=
sz
))
{
if
(
OB_LIKELY
(
sz
>
0
&&
capacity_
-
position_
>=
sz
))
{
...
@@ -64,13 +64,13 @@ public:
...
@@ -64,13 +64,13 @@ public:
}
}
return
ret
;
return
ret
;
}
}
inline
void
*
alloc
(
const
int64_t
sz
,
const
lib
::
ObMemAttr
&
attr
)
inline
v
irtual
v
oid
*
alloc
(
const
int64_t
sz
,
const
lib
::
ObMemAttr
&
attr
)
{
{
UNUSED
(
attr
);
UNUSED
(
attr
);
return
alloc
(
sz
);
return
alloc
(
sz
);
}
}
inline
void
free
()
inline
v
irtual
v
oid
free
()
{
{
position_
=
0
;
position_
=
0
;
}
}
...
...
deps/oblib/src/lib/alloc/ob_tenant_ctx_allocator.h
浏览文件 @
9007c77b
...
@@ -66,6 +66,8 @@ public:
...
@@ -66,6 +66,8 @@ public:
attr
.
tenant_id_
=
tenant_id
;
attr
.
tenant_id_
=
tenant_id
;
attr
.
ctx_id_
=
ctx_id
;
attr
.
ctx_id_
=
ctx_id
;
}
}
virtual
~
ObTenantCtxAllocator
()
{}
int
set_tenant_memory_mgr
()
int
set_tenant_memory_mgr
()
{
{
int
ret
=
common
::
OB_SUCCESS
;
int
ret
=
common
::
OB_SUCCESS
;
...
...
deps/oblib/src/lib/allocator/ob_allocator.h
浏览文件 @
9007c77b
...
@@ -17,41 +17,23 @@
...
@@ -17,41 +17,23 @@
#include "lib/alloc/alloc_struct.h"
#include "lib/alloc/alloc_struct.h"
namespace
oceanbase
{
namespace
oceanbase
{
namespace
lib
{
struct
ObMemAttr
;
}
// end of namespace lib
namespace
common
{
namespace
common
{
using
lib
::
ObMemAttr
;
using
lib
::
ObMemAttr
;
extern
ObMemAttr
default_memattr
;
extern
ObMemAttr
default_memattr
;
class
ObIAllocator
{
class
ObIAllocator
{
public:
virtual
~
ObIAllocator
(){};
public:
public:
/************************************************************************/
/************************************************************************/
/* New Interface (Under construction) */
/* New Interface (Under construction) */
/************************************************************************/
/************************************************************************/
// Use attr passed in by set_attr().
// Use attr passed in by set_attr().
virtual
void
*
alloc
(
const
int64_t
size
)
virtual
void
*
alloc
(
const
int64_t
size
)
=
0
;
{
virtual
void
*
alloc
(
const
int64_t
size
,
const
ObMemAttr
&
attr
)
=
0
;
UNUSED
(
size
);
return
NULL
;
}
virtual
void
*
alloc
(
const
int64_t
size
,
const
ObMemAttr
&
attr
)
{
UNUSED
(
size
);
UNUSED
(
attr
);
return
NULL
;
}
virtual
void
*
realloc
(
const
void
*
ptr
,
const
int64_t
size
,
const
ObMemAttr
&
attr
)
virtual
void
*
realloc
(
const
void
*
ptr
,
const
int64_t
size
,
const
ObMemAttr
&
attr
)
{
{
UNUSED
(
ptr
);
UNUSED
(
ptr
);
UNUSED
(
size
);
UNUSED
(
size
);
UNUSED
(
attr
);
UNUSED
(
attr
);
return
NULL
;
return
nullptr
;
}
}
virtual
void
*
realloc
(
void
*
ptr
,
const
int64_t
oldsz
,
const
int64_t
newsz
)
virtual
void
*
realloc
(
void
*
ptr
,
const
int64_t
oldsz
,
const
int64_t
newsz
)
...
@@ -59,13 +41,10 @@ public:
...
@@ -59,13 +41,10 @@ public:
UNUSED
(
ptr
);
UNUSED
(
ptr
);
UNUSED
(
oldsz
);
UNUSED
(
oldsz
);
UNUSED
(
newsz
);
UNUSED
(
newsz
);
return
NULL
;
return
nullptr
;
}
}
virtual
void
free
(
void
*
ptr
)
virtual
void
free
(
void
*
ptr
)
=
0
;
{
UNUSED
(
ptr
);
}
virtual
int64_t
total
()
const
virtual
int64_t
total
()
const
{
{
...
...
deps/oblib/src/lib/allocator/ob_allocator_v2.h
浏览文件 @
9007c77b
...
@@ -38,12 +38,14 @@ class ObAllocator : public ObIAllocator {
...
@@ -38,12 +38,14 @@ class ObAllocator : public ObIAllocator {
public:
public:
ObAllocator
(
__MemoryContext__
*
mem_context
,
const
ObMemAttr
&
attr
=
default_memattr
,
const
bool
use_pm
=
false
,
ObAllocator
(
__MemoryContext__
*
mem_context
,
const
ObMemAttr
&
attr
=
default_memattr
,
const
bool
use_pm
=
false
,
const
uint32_t
ablock_size
=
lib
::
INTACT_NORMAL_AOBJECT_SIZE
);
const
uint32_t
ablock_size
=
lib
::
INTACT_NORMAL_AOBJECT_SIZE
);
virtual
~
ObAllocator
()
{}
void
*
alloc
(
const
int64_t
size
)
override
void
*
alloc
(
const
int64_t
size
)
override
{
{
return
alloc
(
size
,
attr_
);
return
alloc
(
size
,
attr_
);
}
}
void
*
alloc
(
const
int64_t
size
,
const
ObMemAttr
&
attr
)
override
;
v
irtual
v
oid
*
alloc
(
const
int64_t
size
,
const
ObMemAttr
&
attr
)
override
;
void
free
(
void
*
ptr
)
override
;
v
irtual
v
oid
free
(
void
*
ptr
)
override
;
int64_t
hold
()
const
;
int64_t
hold
()
const
;
int64_t
total
()
const
override
int64_t
total
()
const
override
{
{
...
...
deps/oblib/src/lib/allocator/ob_fifo_allocator.h
浏览文件 @
9007c77b
...
@@ -79,7 +79,7 @@ public:
...
@@ -79,7 +79,7 @@ public:
public:
public:
explicit
ObFIFOAllocator
(
const
uint64_t
tenant_id
=
OB_SERVER_TENANT_ID
);
explicit
ObFIFOAllocator
(
const
uint64_t
tenant_id
=
OB_SERVER_TENANT_ID
);
~
ObFIFOAllocator
();
virtual
~
ObFIFOAllocator
();
int
init
(
ObIAllocator
*
allocator
,
const
int64_t
page_size
,
const
ObMemAttr
&
attr
=
default_memattr
,
int
init
(
ObIAllocator
*
allocator
,
const
int64_t
page_size
,
const
ObMemAttr
&
attr
=
default_memattr
,
const
int64_t
init_size
=
0
,
const
int64_t
idle_size
=
256L
<<
10
,
const
int64_t
max_size
=
INT64_MAX
);
const
int64_t
init_size
=
0
,
const
int64_t
idle_size
=
256L
<<
10
,
const
int64_t
max_size
=
INT64_MAX
);
...
...
deps/oblib/src/lib/allocator/ob_malloc.h
浏览文件 @
9007c77b
...
@@ -156,7 +156,7 @@ public:
...
@@ -156,7 +156,7 @@ public:
{}
{}
public:
public:
virtual
void
*
alloc
(
int64_t
sz
)
virtual
void
*
alloc
(
int64_t
sz
)
override
{
{
char
*
ptr
=
NULL
;
char
*
ptr
=
NULL
;
if
(
OB_SUCCESS
==
mem_buf_
.
ensure_space
(
sz
,
label_
))
{
if
(
OB_SUCCESS
==
mem_buf_
.
ensure_space
(
sz
,
label_
))
{
...
@@ -164,12 +164,12 @@ public:
...
@@ -164,12 +164,12 @@ public:
}
}
return
ptr
;
return
ptr
;
}
}
virtual
void
*
alloc
(
int64_t
sz
,
const
ObMemAttr
&
attr
)
virtual
void
*
alloc
(
int64_t
sz
,
const
ObMemAttr
&
attr
)
override
{
{
UNUSEDx
(
attr
);
UNUSEDx
(
attr
);
return
alloc
(
sz
);
return
alloc
(
sz
);
}
}
virtual
void
free
(
char
*
ptr
)
virtual
void
free
(
void
*
ptr
)
override
{
{
UNUSED
(
ptr
);
UNUSED
(
ptr
);
}
}
...
@@ -185,7 +185,7 @@ public:
...
@@ -185,7 +185,7 @@ public:
{}
{}
public:
public:
virtual
void
*
alloc
(
int64_t
sz
)
virtual
void
*
alloc
(
int64_t
sz
)
override
{
{
char
*
ptr
=
NULL
;
char
*
ptr
=
NULL
;
if
(
mem_buf_len_
>=
sz
)
{
if
(
mem_buf_len_
>=
sz
)
{
...
@@ -193,12 +193,12 @@ public:
...
@@ -193,12 +193,12 @@ public:
}
}
return
ptr
;
return
ptr
;
}
}
virtual
void
*
alloc
(
int64_t
sz
,
const
ObMemAttr
&
attr
)
virtual
void
*
alloc
(
int64_t
sz
,
const
ObMemAttr
&
attr
)
override
{
{
UNUSEDx
(
attr
);
UNUSEDx
(
attr
);
return
alloc
(
sz
);
return
alloc
(
sz
);
}
}
virtual
void
free
(
char
*
ptr
)
virtual
void
free
(
void
*
ptr
)
override
{
{
UNUSED
(
ptr
);
UNUSED
(
ptr
);
}
}
...
...
deps/oblib/src/lib/container/ob_se_array.h
浏览文件 @
9007c77b
...
@@ -49,6 +49,11 @@ public:
...
@@ -49,6 +49,11 @@ public:
return
nullptr
;
return
nullptr
;
}
}
virtual
void
free
(
void
*
p
)
override
{
UNUSED
(
p
);
}
virtual
~
ObNullAllocator
(){};
virtual
~
ObNullAllocator
(){};
};
};
...
@@ -61,6 +66,13 @@ static inline void init_block_allocator(lib::MemoryContext& mem_entity, ModulePa
...
@@ -61,6 +66,13 @@ static inline void init_block_allocator(lib::MemoryContext& mem_entity, ModulePa
{
{
block_allocator
=
ModulePageAllocator
(
mem_entity
->
get_allocator
(),
block_allocator
.
get_label
());
block_allocator
=
ModulePageAllocator
(
mem_entity
->
get_allocator
(),
block_allocator
.
get_label
());
}
}
static
inline
void
init_block_allocator
(
lib
::
MemoryContext
&
mem_context
,
ObIAllocator
&
block_allocator
)
{
// this implement is invalid, just for compilation.
// protected by static_assert.
UNUSED
(
mem_context
);
UNUSED
(
block_allocator
);
}
// ObSEArrayImpl is a high performant array for OceanBase developers,
// ObSEArrayImpl is a high performant array for OceanBase developers,
// to guarantee performance, it should be used in this way
// to guarantee performance, it should be used in this way
...
@@ -69,6 +81,8 @@ static inline void init_block_allocator(lib::MemoryContext& mem_entity, ModulePa
...
@@ -69,6 +81,8 @@ static inline void init_block_allocator(lib::MemoryContext& mem_entity, ModulePa
static
const
int64_t
OB_DEFAULT_SE_ARRAY_COUNT
=
64
;
static
const
int64_t
OB_DEFAULT_SE_ARRAY_COUNT
=
64
;
template
<
typename
T
,
int64_t
LOCAL_ARRAY_SIZE
,
typename
BlockAllocatorT
=
ModulePageAllocator
,
bool
auto_free
=
false
>
template
<
typename
T
,
int64_t
LOCAL_ARRAY_SIZE
,
typename
BlockAllocatorT
=
ModulePageAllocator
,
bool
auto_free
=
false
>
class
ObSEArrayImpl
:
public
ObIArray
<
T
>
{
class
ObSEArrayImpl
:
public
ObIArray
<
T
>
{
static_assert
(
std
::
is_constructible
<
BlockAllocatorT
>::
value
||
!
auto_free
,
"BlockAllocatorT can not be constructed."
);
public:
public:
using
ObIArray
<
T
>::
count
;
using
ObIArray
<
T
>::
count
;
using
ObIArray
<
T
>::
at
;
using
ObIArray
<
T
>::
at
;
...
...
src/election/ob_election_msg.h
浏览文件 @
9007c77b
...
@@ -87,7 +87,7 @@ public:
...
@@ -87,7 +87,7 @@ public:
{
{
(
void
)
set_data
(
buf_
,
MAX_MSGBUF_SIZE
);
(
void
)
set_data
(
buf_
,
MAX_MSGBUF_SIZE
);
}
}
~
ObElectionMsgBuffer
()
virtual
~
ObElectionMsgBuffer
()
{}
{}
TO_STRING_KV
(
K_
(
capacity
),
K_
(
position
),
K_
(
limit
));
TO_STRING_KV
(
K_
(
capacity
),
K_
(
position
),
K_
(
limit
));
...
...
src/liboblog/src/ob_small_arena.h
浏览文件 @
9007c77b
...
@@ -57,12 +57,16 @@ public:
...
@@ -57,12 +57,16 @@ public:
ObSmallArena
();
ObSmallArena
();
~
ObSmallArena
();
~
ObSmallArena
();
void
*
alloc_aligned
(
const
int64_t
size
,
const
int64_t
align
);
void
*
alloc_aligned
(
const
int64_t
size
,
const
int64_t
align
);
v
oid
*
alloc
(
const
int64_t
size
,
const
common
::
ObMemAttr
&
attr
)
v
irtual
void
*
alloc
(
const
int64_t
size
,
const
common
::
ObMemAttr
&
attr
)
override
{
{
UNUSEDx
(
attr
);
UNUSEDx
(
attr
);
return
alloc
(
size
);
return
alloc
(
size
);
}
}
void
*
alloc
(
const
int64_t
size
);
virtual
void
*
alloc
(
const
int64_t
size
)
override
;
virtual
void
free
(
void
*
ptr
)
override
{
UNUSED
(
ptr
);
}
void
reset
();
void
reset
();
int64_t
get_small_alloc_count
()
const
;
int64_t
get_small_alloc_count
()
const
;
int64_t
get_large_alloc_count
()
const
;
int64_t
get_large_alloc_count
()
const
;
...
...
src/share/schema/ob_schema_struct.h
浏览文件 @
9007c77b
...
@@ -2173,12 +2173,12 @@ public:
...
@@ -2173,12 +2173,12 @@ public:
ObSchemaAllocator
(
common
::
ObIAllocator
&
allocator
)
:
allocator_
(
&
allocator
)
ObSchemaAllocator
(
common
::
ObIAllocator
&
allocator
)
:
allocator_
(
&
allocator
)
{}
{}
virtual
void
*
alloc
(
const
int64_t
sz
)
virtual
void
*
alloc
(
const
int64_t
sz
)
override
{
{
return
alloc
(
sz
,
common
::
default_memattr
);
return
alloc
(
sz
,
common
::
default_memattr
);
}
}
virtual
void
*
alloc
(
const
int64_t
sz
,
const
common
::
ObMemAttr
&
attr
)
virtual
void
*
alloc
(
const
int64_t
sz
,
const
common
::
ObMemAttr
&
attr
)
override
{
{
void
*
ret
=
NULL
;
void
*
ret
=
NULL
;
if
(
allocator_
)
{
if
(
allocator_
)
{
...
@@ -2187,6 +2187,10 @@ public:
...
@@ -2187,6 +2187,10 @@ public:
return
ret
;
return
ret
;
}
}
virtual
void
free
(
void
*
p
)
override
{
allocator_
->
free
(
p
);
}
virtual
~
ObSchemaAllocator
(){};
virtual
~
ObSchemaAllocator
(){};
private:
private:
...
...
src/sql/engine/expr/ob_expr.h
浏览文件 @
9007c77b
...
@@ -344,6 +344,15 @@ public:
...
@@ -344,6 +344,15 @@ public:
{}
{}
void
*
alloc
(
const
int64_t
size
)
override
;
void
*
alloc
(
const
int64_t
size
)
override
;
void
*
alloc
(
const
int64_t
size
,
const
common
::
ObMemAttr
&
attr
)
override
{
UNUSED
(
attr
);
return
alloc
(
size
);
}
void
free
(
void
*
ptr
)
override
{
UNUSED
(
ptr
);
}
private:
private:
int64_t
off_
;
int64_t
off_
;
...
...
src/sql/engine/expr/ob_expr_regexp_context.h
浏览文件 @
9007c77b
...
@@ -41,6 +41,15 @@ public:
...
@@ -41,6 +41,15 @@ public:
}
}
virtual
void
*
alloc
(
const
int64_t
size
)
override
;
virtual
void
*
alloc
(
const
int64_t
size
)
override
;
virtual
void
*
alloc
(
const
int64_t
size
,
const
common
::
ObMemAttr
&
attr
)
override
{
UNUSED
(
attr
);
return
alloc
(
size
);
}
virtual
void
free
(
void
*
ptr
)
override
{
UNUSED
(
ptr
);
}
private:
private:
common
::
ObIAllocator
*
alloc_
;
common
::
ObIAllocator
*
alloc_
;
...
...
src/sql/plan_cache/ob_id_manager_allocator.h
浏览文件 @
9007c77b
...
@@ -31,11 +31,16 @@ public:
...
@@ -31,11 +31,16 @@ public:
int
init
(
const
int64_t
obj_size
,
const
char
*
label
,
uint64_t
tenant_id_
);
int
init
(
const
int64_t
obj_size
,
const
char
*
label
,
uint64_t
tenant_id_
);
void
*
alloc
(
int64_t
sz
)
void
*
alloc
(
const
int64_t
sz
)
override
{
{
return
alloc_
(
sz
);
return
alloc_
(
sz
);
}
}
void
free
(
void
*
ptr
)
void
*
alloc
(
const
int64_t
size
,
const
common
::
ObMemAttr
&
attr
)
override
{
UNUSED
(
attr
);
return
alloc
(
size
);
}
void
free
(
void
*
ptr
)
override
{
{
free_
(
ptr
);
free_
(
ptr
);
}
}
...
...
src/storage/memtable/ob_memtable_context.h
浏览文件 @
9007c77b
...
@@ -168,7 +168,7 @@ public:
...
@@ -168,7 +168,7 @@ public:
ATOMIC_STORE
(
&
free_count_
,
0
);
ATOMIC_STORE
(
&
free_count_
,
0
);
ATOMIC_STORE
(
&
alloc_size_
,
0
);
ATOMIC_STORE
(
&
alloc_size_
,
0
);
}
}
void
*
alloc
(
const
int64_t
size
)
void
*
alloc
(
const
int64_t
size
)
override
{
{
void
*
ret
=
nullptr
;
void
*
ret
=
nullptr
;
if
(
OB_ISNULL
(
ret
=
allocator_
.
alloc
(
size
)))
{
if
(
OB_ISNULL
(
ret
=
allocator_
.
alloc
(
size
)))
{
...
@@ -179,7 +179,12 @@ public:
...
@@ -179,7 +179,12 @@ public:
}
}
return
ret
;
return
ret
;
}
}
void
free
(
void
*
ptr
)
void
*
alloc
(
const
int64_t
size
,
const
ObMemAttr
&
attr
)
override
{
UNUSED
(
attr
);
return
alloc
(
size
);
}
void
free
(
void
*
ptr
)
override
{
{
if
(
OB_ISNULL
(
ptr
))
{
if
(
OB_ISNULL
(
ptr
))
{
// do nothing
// do nothing
...
@@ -244,7 +249,7 @@ public:
...
@@ -244,7 +249,7 @@ public:
ATOMIC_STORE
(
&
free_count_
,
0
);
ATOMIC_STORE
(
&
free_count_
,
0
);
ATOMIC_STORE
(
&
alloc_size_
,
0
);
ATOMIC_STORE
(
&
alloc_size_
,
0
);
}
}
void
*
alloc
(
const
int64_t
size
)
void
*
alloc
(
const
int64_t
size
)
override
{
{
void
*
ret
=
nullptr
;
void
*
ret
=
nullptr
;
if
(
OB_ISNULL
(
ret
=
allocator_
.
alloc
(
size
)))
{
if
(
OB_ISNULL
(
ret
=
allocator_
.
alloc
(
size
)))
{
...
@@ -255,7 +260,12 @@ public:
...
@@ -255,7 +260,12 @@ public:
}
}
return
ret
;
return
ret
;
}
}
void
free
(
void
*
ptr
)
void
*
alloc
(
const
int64_t
size
,
const
ObMemAttr
&
attr
)
override
{
UNUSED
(
attr
);
return
alloc
(
size
);
}
void
free
(
void
*
ptr
)
override
{
{
if
(
OB_ISNULL
(
ptr
))
{
if
(
OB_ISNULL
(
ptr
))
{
// do nothing
// do nothing
...
...
unittest/sql/engine/basic/test_ra_row_store_projector.cpp
浏览文件 @
9007c77b
...
@@ -76,6 +76,10 @@ class ObEmptyAlloc : public ObIAllocator {
...
@@ -76,6 +76,10 @@ class ObEmptyAlloc : public ObIAllocator {
{
{
return
NULL
;
return
NULL
;
}
}
void
free
(
void
*
ptr
)
override
{
UNUSED
(
ptr
);
}
};
};
TEST
(
RARowStore
,
alloc_project_fail
)
TEST
(
RARowStore
,
alloc_project_fail
)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录