Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
41cdb1e9
T
TDengine
项目概览
taosdata
/
TDengine
1 年多 前同步成功
通知
1185
Star
22017
Fork
4786
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
T
TDengine
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1
Issue
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
41cdb1e9
编写于
10月 26, 2022
作者:
A
Alex Duan
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix(coverage): remove the function about skiplist callback
上级
78ff5f75
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
0 addition
and
130 deletion
+0
-130
include/util/tfunctional.h
include/util/tfunctional.h
+0
-56
include/util/tskiplist.h
include/util/tskiplist.h
+0
-2
source/util/src/tfunctional.c
source/util/src/tfunctional.c
+0
-48
source/util/src/tskiplist.c
source/util/src/tskiplist.c
+0
-24
未找到文件。
include/util/tfunctional.h
已删除
100644 → 0
浏览文件 @
78ff5f75
/*
* Copyright (c) 2019 TAOS Data, Inc. <jhtao@taosdata.com>
*
* This program is free software: you can use, redistribute, and/or modify
* it under the terms of the GNU Affero General Public License, version 3
* or later ("AGPL"), as published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef _TD_UTIL_FUNCTIONAL_H_
#define _TD_UTIL_FUNCTIONAL_H_
#include "os.h"
#ifdef __cplusplus
extern
"C"
{
#endif
// TODO: hard to use, trying to rewrite it using va_list
typedef
void
*
(
*
GenericVaFunc
)(
void
*
args
[]);
typedef
int32_t
(
*
I32VaFunc
)(
void
*
args
[]);
typedef
void
(
*
VoidVaFunc
)(
void
*
args
[]);
typedef
struct
GenericSavedFunc
{
GenericVaFunc
func
;
void
*
args
[];
}
tGenericSavedFunc
;
typedef
struct
I32SavedFunc
{
I32VaFunc
func
;
void
*
args
[];
}
tI32SavedFunc
;
typedef
struct
VoidSavedFunc
{
VoidVaFunc
func
;
void
*
args
[];
}
tVoidSavedFunc
;
tGenericSavedFunc
*
genericSavedFuncInit
(
GenericVaFunc
func
,
int32_t
numOfArgs
);
tI32SavedFunc
*
i32SavedFuncInit
(
I32VaFunc
func
,
int32_t
numOfArgs
);
tVoidSavedFunc
*
voidSavedFuncInit
(
VoidVaFunc
func
,
int32_t
numOfArgs
);
void
*
genericInvoke
(
tGenericSavedFunc
*
const
pSavedFunc
);
int32_t
i32Invoke
(
tI32SavedFunc
*
const
pSavedFunc
);
void
voidInvoke
(
tVoidSavedFunc
*
const
pSavedFunc
);
#ifdef __cplusplus
}
#endif
#endif
/*_TD_UTIL_FUNCTIONAL_H_*/
include/util/tskiplist.h
浏览文件 @
41cdb1e9
...
...
@@ -19,7 +19,6 @@
#include "os.h"
#include "taos.h"
#include "tarray.h"
#include "tfunctional.h"
#ifdef __cplusplus
extern
"C"
{
...
...
@@ -67,7 +66,6 @@ typedef struct SSkipList {
uint32_t
size
;
SSkipListNode
*
pHead
;
// point to the first element
SSkipListNode
*
pTail
;
// point to the last element
tGenericSavedFunc
*
insertHandleFn
;
}
SSkipList
;
typedef
struct
SSkipListIterator
{
...
...
source/util/src/tfunctional.c
已删除
100644 → 0
浏览文件 @
78ff5f75
/*
* Copyright (c) 2019 TAOS Data, Inc. <jhtao@taosdata.com>
*
* This program is free software: you can use, redistribute, and/or modify
* it under the terms of the GNU Affero General Public License, version 3
* or later ("AGPL"), as published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#define _DEFAULT_SOURCE
#include "tfunctional.h"
FORCE_INLINE
void
*
genericInvoke
(
tGenericSavedFunc
*
const
pSavedFunc
)
{
return
pSavedFunc
->
func
(
pSavedFunc
->
args
);
}
#if 0
tGenericSavedFunc* genericSavedFuncInit(GenericVaFunc func, int32_t numOfArgs) {
tGenericSavedFunc* pSavedFunc = taosMemoryMalloc(sizeof(tGenericSavedFunc) + numOfArgs * (sizeof(void*)));
if (pSavedFunc == NULL) return NULL;
pSavedFunc->func = func;
return pSavedFunc;
}
tI32SavedFunc* i32SavedFuncInit(I32VaFunc func, int32_t numOfArgs) {
tI32SavedFunc* pSavedFunc = taosMemoryMalloc(sizeof(tI32SavedFunc) + numOfArgs * sizeof(void*));
if (pSavedFunc == NULL) return NULL;
pSavedFunc->func = func;
return pSavedFunc;
}
tVoidSavedFunc* voidSavedFuncInit(VoidVaFunc func, int32_t numOfArgs) {
tVoidSavedFunc* pSavedFunc = taosMemoryMalloc(sizeof(tVoidSavedFunc) + numOfArgs * sizeof(void*));
if (pSavedFunc == NULL) return NULL;
pSavedFunc->func = func;
return pSavedFunc;
}
FORCE_INLINE int32_t i32Invoke(tI32SavedFunc* const pSavedFunc) { return pSavedFunc->func(pSavedFunc->args); }
FORCE_INLINE void voidInvoke(tVoidSavedFunc* const pSavedFunc) {
if (pSavedFunc) pSavedFunc->func(pSavedFunc->args);
}
#endif
\ No newline at end of file
source/util/src/tskiplist.c
浏览文件 @
41cdb1e9
...
...
@@ -87,7 +87,6 @@ SSkipList *tSkipListCreate(uint8_t maxLevel, uint8_t keyType, uint16_t keyLen, _
#if SKIP_LIST_RECORD_PERFORMANCE
pSkipList
->
state
.
nTotalMemSize
+=
sizeof
(
SSkipList
);
#endif
pSkipList
->
insertHandleFn
=
NULL
;
return
pSkipList
;
}
...
...
@@ -105,8 +104,6 @@ void tSkipListDestroy(SSkipList *pSkipList) {
tSkipListFreeNode
(
pTemp
);
}
taosMemoryFreeClear
(
pSkipList
->
insertHandleFn
);
tSkipListUnlock
(
pSkipList
);
if
(
pSkipList
->
lock
!=
NULL
)
{
taosThreadRwlockDestroy
(
pSkipList
->
lock
);
...
...
@@ -684,35 +681,14 @@ static SSkipListNode *tSkipListPutImpl(SSkipList *pSkipList, void *pData, SSkipL
}
else
{
pNode
=
SL_NODE_GET_BACKWARD_POINTER
(
direction
[
0
],
0
);
}
if
(
pSkipList
->
insertHandleFn
)
{
pSkipList
->
insertHandleFn
->
args
[
0
]
=
pData
;
pSkipList
->
insertHandleFn
->
args
[
1
]
=
pNode
->
pData
;
pData
=
genericInvoke
(
pSkipList
->
insertHandleFn
);
}
if
(
pData
)
{
atomic_store_ptr
(
&
(
pNode
->
pData
),
pData
);
}
}
else
{
// for compatiblity, duplicate key inserted when update=0 should be also calculated as affected rows!
if
(
pSkipList
->
insertHandleFn
)
{
pSkipList
->
insertHandleFn
->
args
[
0
]
=
NULL
;
pSkipList
->
insertHandleFn
->
args
[
1
]
=
NULL
;
genericInvoke
(
pSkipList
->
insertHandleFn
);
}
}
}
else
{
pNode
=
tSkipListNewNode
(
getSkipListRandLevel
(
pSkipList
));
if
(
pNode
!=
NULL
)
{
// insertHandleFn will be assigned only for timeseries data,
// in which case, pData is pointed to an memory to be freed later;
// while for metadata, the mem alloc will not be called.
if
(
pSkipList
->
insertHandleFn
)
{
pSkipList
->
insertHandleFn
->
args
[
0
]
=
pData
;
pSkipList
->
insertHandleFn
->
args
[
1
]
=
NULL
;
pData
=
genericInvoke
(
pSkipList
->
insertHandleFn
);
}
pNode
->
pData
=
pData
;
tSkipListDoInsert
(
pSkipList
,
direction
,
pNode
,
isForward
);
}
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录