Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
2dot5
ClickHouse
提交
bdd3bc81
C
ClickHouse
项目概览
2dot5
/
ClickHouse
通知
3
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
C
ClickHouse
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
bdd3bc81
编写于
7月 17, 2019
作者:
P
proller
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix
上级
17dd579d
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
6 addition
and
22 deletion
+6
-22
dbms/src/Common/Arena.h
dbms/src/Common/Arena.h
+0
-18
dbms/src/Common/ArenaWithFreeLists.h
dbms/src/Common/ArenaWithFreeLists.h
+1
-4
dbms/src/Core/Defines.h
dbms/src/Core/Defines.h
+5
-0
未找到文件。
dbms/src/Common/Arena.h
浏览文件 @
bdd3bc81
...
...
@@ -57,9 +57,7 @@ private:
end
=
begin
+
size_
-
pad_right
;
prev
=
prev_
;
#if __has_include(<sanitizer/asan_interface.h>)
ASAN_POISON_MEMORY_REGION
(
begin
,
size_
);
#endif
}
~
Chunk
()
...
...
@@ -68,9 +66,7 @@ private:
/// because the allocator might not have asan integration, and the
/// memory would stay poisoned forever. If the allocator supports
/// asan, it will correctly poison the memory by itself.
#if __has_include(<sanitizer/asan_interface.h>)
ASAN_UNPOISON_MEMORY_REGION
(
begin
,
size
());
#endif
Allocator
<
false
>::
free
(
begin
,
size
());
...
...
@@ -142,9 +138,7 @@ public:
char
*
res
=
head
->
pos
;
head
->
pos
+=
size
;
#if __has_include(<sanitizer/asan_interface.h>)
ASAN_UNPOISON_MEMORY_REGION
(
res
,
size
+
pad_right
);
#endif
return
res
;
}
...
...
@@ -163,9 +157,7 @@ public:
head
->
pos
=
static_cast
<
char
*>
(
head_pos
);
head
->
pos
+=
size
;
#if __has_include(<sanitizer/asan_interface.h>)
ASAN_UNPOISON_MEMORY_REGION
(
res
,
size
+
pad_right
);
#endif
return
res
;
}
...
...
@@ -186,9 +178,7 @@ public:
void
rollback
(
size_t
size
)
{
head
->
pos
-=
size
;
#if __has_include(<sanitizer/asan_interface.h>)
ASAN_POISON_MEMORY_REGION
(
head
->
pos
,
size
+
pad_right
);
#endif
}
/** Begin or expand allocation of contiguous piece of memory without alignment.
...
...
@@ -215,9 +205,7 @@ public:
if
(
!
begin
)
begin
=
res
;
#if __has_include(<sanitizer/asan_interface.h>)
ASAN_UNPOISON_MEMORY_REGION
(
res
,
size
+
pad_right
);
#endif
return
res
;
}
...
...
@@ -250,9 +238,7 @@ public:
if
(
!
begin
)
begin
=
res
;
#if __has_include(<sanitizer/asan_interface.h>)
ASAN_UNPOISON_MEMORY_REGION
(
res
,
size
+
pad_right
);
#endif
return
res
;
}
...
...
@@ -263,9 +249,7 @@ public:
if
(
old_data
)
{
memcpy
(
res
,
old_data
,
old_size
);
#if __has_include(<sanitizer/asan_interface.h>)
ASAN_POISON_MEMORY_REGION
(
old_data
,
old_size
);
#endif
}
return
res
;
}
...
...
@@ -276,9 +260,7 @@ public:
if
(
old_data
)
{
memcpy
(
res
,
old_data
,
old_size
);
#if __has_include(<sanitizer/asan_interface.h>)
ASAN_POISON_MEMORY_REGION
(
old_data
,
old_size
);
#endif
}
return
res
;
}
...
...
dbms/src/Common/ArenaWithFreeLists.h
浏览文件 @
bdd3bc81
...
...
@@ -3,6 +3,7 @@
#if __has_include(<sanitizer/asan_interface.h>)
# include <sanitizer/asan_interface.h>
#endif
#include <Core/Defines.h>
#include <Common/Arena.h>
#include <Common/BitHelpers.h>
...
...
@@ -70,10 +71,8 @@ public:
/// item in the list. We poisoned the free block before putting
/// it into the free list, so we have to unpoison it before
/// reading anything.
#if __has_include(<sanitizer/asan_interface.h>)
ASAN_UNPOISON_MEMORY_REGION
(
free_block_ptr
,
std
::
max
(
size
,
sizeof
(
Block
)));
#endif
const
auto
res
=
free_block_ptr
->
data
;
free_block_ptr
=
free_block_ptr
->
next
;
...
...
@@ -104,9 +103,7 @@ public:
/// destructor, to support an underlying allocator that doesn't
/// integrate with asan. We don't do that, and rely on the fact that
/// our underlying allocator is Arena, which does have asan integration.
#if __has_include(<sanitizer/asan_interface.h>)
ASAN_POISON_MEMORY_REGION
(
ptr
,
1ULL
<<
(
list_idx
+
1
));
#endif
}
/// Size of the allocated pool in bytes
...
...
dbms/src/Core/Defines.h
浏览文件 @
bdd3bc81
...
...
@@ -139,3 +139,8 @@
/// This number is only used for distributed version compatible.
/// It could be any magic number.
#define DBMS_DISTRIBUTED_SENDS_MAGIC_NUMBER 0xCAFECABE
#if !__has_include(<sanitizer/asan_interface.h>)
# define ASAN_UNPOISON_MEMORY_REGION(a,b)
# define ASAN_POISON_MEMORY_REGION(a,b)
#endif
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录