Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
a8882c5c
T
TDengine
项目概览
taosdata
/
TDengine
大约 1 年 前同步成功
通知
1184
Star
22015
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看板
体验新版 GitCode,发现更多精彩内容 >>
提交
a8882c5c
编写于
3月 28, 2022
作者:
H
Hongze Cheng
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
more TDB
上级
8f6ba1fc
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
8 addition
and
8 deletion
+8
-8
source/libs/tdb/src/db/tdbBtree.c
source/libs/tdb/src/db/tdbBtree.c
+1
-1
source/libs/tdb/src/db/tdbDb.c
source/libs/tdb/src/db/tdbDb.c
+1
-1
source/libs/tdb/src/db/tdbPager.c
source/libs/tdb/src/db/tdbPager.c
+1
-1
source/libs/tdb/src/inc/tdbOs.h
source/libs/tdb/src/inc/tdbOs.h
+4
-4
source/libs/tdb/src/page/tdbPage.c
source/libs/tdb/src/page/tdbPage.c
+1
-1
未找到文件。
source/libs/tdb/src/db/tdbBtree.c
浏览文件 @
a8882c5c
...
@@ -166,7 +166,7 @@ int tdbBtCursorInsert(SBTC *pBtc, const void *pKey, int kLen, const void *pVal,
...
@@ -166,7 +166,7 @@ int tdbBtCursorInsert(SBTC *pBtc, const void *pKey, int kLen, const void *pVal,
// TODO: refact code here
// TODO: refact code here
pBt
=
pBtc
->
pBt
;
pBt
=
pBtc
->
pBt
;
if
(
!
pBt
->
pTmp
)
{
if
(
!
pBt
->
pTmp
)
{
pBt
->
pTmp
=
(
u8
*
)
m
alloc
(
pBt
->
pageSize
);
pBt
->
pTmp
=
(
u8
*
)
tdbOsM
alloc
(
pBt
->
pageSize
);
if
(
pBt
->
pTmp
==
NULL
)
{
if
(
pBt
->
pTmp
==
NULL
)
{
return
-
1
;
return
-
1
;
}
}
...
...
source/libs/tdb/src/db/tdbDb.c
浏览文件 @
a8882c5c
...
@@ -101,7 +101,7 @@ int tdbDbcOpen(STDB *pDb, STDBC **ppDbc) {
...
@@ -101,7 +101,7 @@ int tdbDbcOpen(STDB *pDb, STDBC **ppDbc) {
STDBC
*
pDbc
=
NULL
;
STDBC
*
pDbc
=
NULL
;
*
ppDbc
=
NULL
;
*
ppDbc
=
NULL
;
pDbc
=
m
alloc
(
sizeof
(
*
pDbc
));
pDbc
=
(
STDBC
*
)
tdbOsM
alloc
(
sizeof
(
*
pDbc
));
if
(
pDbc
==
NULL
)
{
if
(
pDbc
==
NULL
)
{
return
-
1
;
return
-
1
;
}
}
...
...
source/libs/tdb/src/db/tdbPager.c
浏览文件 @
a8882c5c
...
@@ -222,7 +222,7 @@ static int tdbPagerReadPage(SPager *pPager, SPage *pPage) {
...
@@ -222,7 +222,7 @@ static int tdbPagerReadPage(SPager *pPager, SPage *pPage) {
ASSERT
(
memcmp
(
pPager
->
fid
,
pPage
->
pgid
.
fileid
,
TDB_FILE_ID_LEN
)
==
0
);
ASSERT
(
memcmp
(
pPager
->
fid
,
pPage
->
pgid
.
fileid
,
TDB_FILE_ID_LEN
)
==
0
);
offset
=
(
pPage
->
pgid
.
pgno
-
1
)
*
(
i64
)(
pPager
->
pageSize
);
offset
=
(
pPage
->
pgid
.
pgno
-
1
)
*
(
i64
)(
pPager
->
pageSize
);
ret
=
tdbPRead
(
pPager
->
fd
,
pPage
->
pData
,
pPager
->
pageSize
,
offset
);
ret
=
tdb
Os
PRead
(
pPager
->
fd
,
pPage
->
pData
,
pPager
->
pageSize
,
offset
);
if
(
ret
<
0
)
{
if
(
ret
<
0
)
{
// TODO: handle error
// TODO: handle error
return
-
1
;
return
-
1
;
...
...
source/libs/tdb/src/inc/tdbOs.h
浏览文件 @
a8882c5c
...
@@ -49,9 +49,9 @@ typedef TdFilePtr tdb_fd_t;
...
@@ -49,9 +49,9 @@ typedef TdFilePtr tdb_fd_t;
#else
#else
#define tdbOsOpen open
#define tdbOsOpen open
#define tdbOsClose close
#define tdbOsClose close
#define tdbOsRead read
#define tdbOsRead read
// TODO
#define tdbOsPRead pread
#define tdbOsPRead pread
// TODO
#define tdbOsWrite write
#define tdbOsWrite write
// TODO
#define tdbOsFSync fsync
#define tdbOsFSync fsync
#endif
#endif
...
@@ -65,7 +65,7 @@ typedef TdThreadSpinlock tdb_spinlock_t;
...
@@ -65,7 +65,7 @@ typedef TdThreadSpinlock tdb_spinlock_t;
#define tdbSpinlockDestroy taosThreadSpinDestroy
#define tdbSpinlockDestroy taosThreadSpinDestroy
#define tdbSpinlockLock taosThreadSpinLock
#define tdbSpinlockLock taosThreadSpinLock
#define tdbSpinlockUnlock taosThreadSpinUnlock
#define tdbSpinlockUnlock taosThreadSpinUnlock
#define tdbSpinlockTrylock
#define tdbSpinlockTrylock
pthread_spin_trylock // TODO
// mutex lock
// mutex lock
typedef
TdThreadMutex
tdb_mutex_t
;
typedef
TdThreadMutex
tdb_mutex_t
;
...
...
source/libs/tdb/src/page/tdbPage.c
浏览文件 @
a8882c5c
...
@@ -144,7 +144,7 @@ int tdbPageInsertCell(SPage *pPage, int idx, SCell *pCell, int szCell, u8 asOvfl
...
@@ -144,7 +144,7 @@ int tdbPageInsertCell(SPage *pPage, int idx, SCell *pCell, int szCell, u8 asOvfl
}
}
// TODO: here has memory leak
// TODO: here has memory leak
pNewCell
=
(
SCell
*
)
m
alloc
(
szCell
);
pNewCell
=
(
SCell
*
)
tdbOsM
alloc
(
szCell
);
memcpy
(
pNewCell
,
pCell
,
szCell
);
memcpy
(
pNewCell
,
pCell
,
szCell
);
pPage
->
apOvfl
[
iOvfl
]
=
pNewCell
;
pPage
->
apOvfl
[
iOvfl
]
=
pNewCell
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录