Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
8b0b351d
TDengine
项目概览
taosdata
/
TDengine
1 年多 前同步成功
通知
1185
Star
22016
Fork
4786
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
TDengine
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1
Issue
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
8b0b351d
编写于
11月 15, 2022
作者:
H
Haojun Liao
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
refactor: do some internal refactor.
上级
c35f668c
变更
5
展开全部
隐藏空白更改
内联
并排
Showing
5 changed file
with
311 addition
and
269 deletion
+311
-269
cmake/cmake.define
cmake/cmake.define
+2
-2
cmake/cmake.platform
cmake/cmake.platform
+2
-2
include/util/thash.h
include/util/thash.h
+1
-1
source/libs/function/src/detail/tavgfunction.c
source/libs/function/src/detail/tavgfunction.c
+303
-261
source/util/src/thash.c
source/util/src/thash.c
+3
-3
未找到文件。
cmake/cmake.define
浏览文件 @
8b0b351d
...
@@ -134,9 +134,9 @@ ELSE ()
...
@@ -134,9 +134,9 @@ ELSE ()
IF("${SIMD_SUPPORT}" MATCHES "true")
IF("${SIMD_SUPPORT}" MATCHES "true")
ADD_DEFINITIONS("-mavx -mavx2")
ADD_DEFINITIONS("-mavx -mavx2")
MESSAGE(STATUS "
cpu simd instruction AVX/AVX2 supported
")
MESSAGE(STATUS "
SIMD instructions (AVX/AVX2) is ACTIVATED
")
ELSE()
ELSE()
MESSAGE(STATUS "
cpu simd instruction AVX/AVX2 NOT supported
")
MESSAGE(STATUS "
SIMD instruction (AVX/AVX2)is NOT ACTIVATED
")
ENDIF()
ENDIF()
ENDIF ()
ENDIF ()
...
...
cmake/cmake.platform
浏览文件 @
8b0b351d
...
@@ -135,5 +135,5 @@ ENDIF ()
...
@@ -135,5 +135,5 @@ ENDIF ()
MESSAGE(STATUS "platform arch:" ${PLATFORM_ARCH_STR})
MESSAGE(STATUS "platform arch:" ${PLATFORM_ARCH_STR})
MESSAGE("C Compiler
ID: ${CMAKE_C_COMPILER_ID}
")
MESSAGE("C Compiler
: ${CMAKE_C_COMPILER} (${CMAKE_C_COMPILER_ID}, ${CMAKE_C_COMPILER_VERSION})
")
MESSAGE("CXX Compiler
ID: ${CMAKE_CXX_COMPILER_ID}
")
MESSAGE("CXX Compiler
: ${CMAKE_CXX_COMPILER} (${CMAKE_C_COMPILER_ID}, ${CMAKE_CXX_COMPILER_VERSION})
")
include/util/thash.h
浏览文件 @
8b0b351d
...
@@ -213,7 +213,7 @@ void taosHashSetEqualFp(SHashObj *pHashObj, _equal_fn_t fp);
...
@@ -213,7 +213,7 @@ void taosHashSetEqualFp(SHashObj *pHashObj, _equal_fn_t fp);
*/
*/
void
taosHashSetFreeFp
(
SHashObj
*
pHashObj
,
_hash_free_fn_t
fp
);
void
taosHashSetFreeFp
(
SHashObj
*
pHashObj
,
_hash_free_fn_t
fp
);
int64_t
taosHashGetCompTimes
(
SHashObj
*
pHashObj
);
//
int64_t taosHashGetCompTimes(SHashObj *pHashObj);
#ifdef __cplusplus
#ifdef __cplusplus
}
}
...
...
source/libs/function/src/detail/tavgfunction.c
浏览文件 @
8b0b351d
此差异已折叠。
点击以展开。
source/util/src/thash.c
浏览文件 @
8b0b351d
...
@@ -67,7 +67,7 @@ struct SHashObj {
...
@@ -67,7 +67,7 @@ struct SHashObj {
bool
enableUpdate
;
// enable update
bool
enableUpdate
;
// enable update
SArray
*
pMemBlock
;
// memory block allocated for SHashEntry
SArray
*
pMemBlock
;
// memory block allocated for SHashEntry
_hash_before_fn_t
callbackFp
;
// function invoked before return the value to caller
_hash_before_fn_t
callbackFp
;
// function invoked before return the value to caller
int64_t
compTimes
;
//
int64_t compTimes;
};
};
/*
/*
...
@@ -147,7 +147,7 @@ static FORCE_INLINE SHashNode *doSearchInEntryList(SHashObj *pHashObj, SHashEntr
...
@@ -147,7 +147,7 @@ static FORCE_INLINE SHashNode *doSearchInEntryList(SHashObj *pHashObj, SHashEntr
uint32_t
hashVal
)
{
uint32_t
hashVal
)
{
SHashNode
*
pNode
=
pe
->
next
;
SHashNode
*
pNode
=
pe
->
next
;
while
(
pNode
)
{
while
(
pNode
)
{
atomic_add_fetch_64
(
&
pHashObj
->
compTimes
,
1
);
//
atomic_add_fetch_64(&pHashObj->compTimes, 1);
if
((
pNode
->
keyLen
==
keyLen
)
&&
((
*
(
pHashObj
->
equalFp
))(
GET_HASH_NODE_KEY
(
pNode
),
key
,
keyLen
)
==
0
)
&&
if
((
pNode
->
keyLen
==
keyLen
)
&&
((
*
(
pHashObj
->
equalFp
))(
GET_HASH_NODE_KEY
(
pNode
),
key
,
keyLen
)
==
0
)
&&
pNode
->
removed
==
0
)
{
pNode
->
removed
==
0
)
{
assert
(
pNode
->
hashVal
==
hashVal
);
assert
(
pNode
->
hashVal
==
hashVal
);
...
@@ -889,4 +889,4 @@ void *taosHashAcquire(SHashObj *pHashObj, const void *key, size_t keyLen) {
...
@@ -889,4 +889,4 @@ void *taosHashAcquire(SHashObj *pHashObj, const void *key, size_t keyLen) {
void
taosHashRelease
(
SHashObj
*
pHashObj
,
void
*
p
)
{
taosHashCancelIterate
(
pHashObj
,
p
);
}
void
taosHashRelease
(
SHashObj
*
pHashObj
,
void
*
p
)
{
taosHashCancelIterate
(
pHashObj
,
p
);
}
int64_t
taosHashGetCompTimes
(
SHashObj
*
pHashObj
)
{
return
atomic_load_64
(
&
pHashObj
->
compTimes
);
}
//
int64_t taosHashGetCompTimes(SHashObj *pHashObj) { return atomic_load_64(&pHashObj->compTimes); }
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录