Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
9521eca2
T
TDengine
项目概览
taosdata
/
TDengine
1 年多 前同步成功
通知
1187
Star
22018
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看板
提交
9521eca2
编写于
11月 10, 2021
作者:
H
Hongze Cheng
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
refact API documentation
上级
5c5d6eb1
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
64 addition
and
53 deletion
+64
-53
CMakeLists.txt
CMakeLists.txt
+20
-9
cmake/cmake.options
cmake/cmake.options
+1
-1
docs/Doxyfile.in
docs/Doxyfile.in
+0
-0
source/dnode/vnode/impl/src/vnodeMemAllocator.c
source/dnode/vnode/impl/src/vnodeMemAllocator.c
+43
-43
未找到文件。
CMakeLists.txt
浏览文件 @
9521eca2
...
...
@@ -74,17 +74,28 @@ target_include_directories(api INTERFACE "include/client")
# src
add_subdirectory
(
source
)
# docs
# docs
# https://vicrucann.github.io/tutorials/quick-cmake-doxygen/
if
(
${
BUILD_DOCS
}
)
find_program
(
DOC_GENERATOR doxygen
)
if
(
NOT DOC_GENERATOR
)
message
(
"doxygen is not found, skip doc build"
)
else
()
execute_process
(
COMMAND doxygen
${
CMAKE_SOURCE_DIR
}
/docs/Doxyfile
WORKING_DIRECTORY
${
CMAKE_SOURCE_DIR
}
find_package
(
Doxygen
)
if
(
DOXYGEN_FOUND
)
# Build the doc
set
(
DOXYGEN_IN
${
CMAKE_SOURCE_DIR
}
/docs/Doxyfile.in
)
set
(
DOXYGEN_OUT
${
CMAKE_BINARY_DIR
}
/Doxyfile
)
configure_file
(
${
DOXYGEN_IN
}
${
DOXYGEN_OUT
}
@ONLY
)
message
(
"Doxygen build start"
)
add_custom_target
(
tdengine_doxygen ALL
COMMAND
${
DOXYGEN_EXECUTABLE
}
${
DOXYGEN_OUT
}
WORKING_DIRECTORY
${
CMAKE_CURRENT_BINARY_DIR
}
COMMENT
"Generating API doxumentation with Doxygen"
VERBATIM
)
endif
(
NOT DOC_GENERATOR
)
else
(
DOXYGEN_FOUND
)
message
(
"Doxygen need to be installed to generate the doxygen documentation"
)
endif
(
DOXYGEN_FOUND
)
endif
(
${
BUILD_DOCS
}
)
# tests (TODO)
cmake/cmake.options
浏览文件 @
9521eca2
...
...
@@ -40,5 +40,5 @@ option(
option(
BUILD_DOCS
"If use doxygen build documents"
O
FF
O
N
)
\ No newline at end of file
docs/Doxyfile
→
docs/Doxyfile
.in
浏览文件 @
9521eca2
文件已移动
source/dnode/vnode/impl/src/vnodeMemAllocator.c
浏览文件 @
9521eca2
...
...
@@ -15,6 +15,9 @@
#include "vnodeDef.h"
#define VNODE_HEAP_ALLOCATOR 0
#define VNODE_ARENA_ALLOCATOR 1
typedef
struct
{
uint64_t
tsize
;
uint64_t
used
;
...
...
@@ -22,9 +25,13 @@ typedef struct {
typedef
struct
SVArenaNode
{
struct
SVArenaNode
*
prev
;
void
*
nptr
;
char
data
[];
}
SVArenaNode
;
typedef
struct
{
SVArenaNode
*
inuse
;
SVArenaNode
node
;
}
SVArenaAllocator
;
typedef
struct
{
...
...
@@ -37,64 +44,57 @@ typedef struct {
};
}
SVMemAllocator
;
SMemAllocator
*
vnodeCreateMemAllocator
(
int8_t
type
,
uint64_t
size
)
{
/* TODO */
return
NULL
;
}
void
vnodeDestroyMemAllocator
(
SMemAllocator
*
pma
)
{
// TODO
}
void
vnodeRefMemAllocator
(
SMemAllocator
*
pma
)
{
// TODO
}
void
vnodeUnrefMemAllocator
(
SMemAllocator
*
pma
)
{
// TODO
}
/* ------------------------ Heap Allocator IMPL ------------------------ */
SMemAllocator
*
vnodeCreateMemAllocator
(
int8_t
type
,
uint64_t
tsize
,
uint64_t
ssize
/* step size only for arena */
)
{
SMemAllocator
*
pma
;
uint64_t
msize
;
SVMemAllocator
*
pva
;
SMemAllocator
*
vhaCreate
(
uint64_t
size
)
{
SMemAllocator
*
pma
;
msize
=
sizeof
(
*
pma
)
+
sizeof
(
SVMemAllocator
);
if
(
type
==
VNODE_ARENA_ALLOCATOR
)
{
msize
+=
tsize
;
}
pma
=
(
SMemAllocator
*
)
calloc
(
1
,
sizeof
(
*
pma
)
+
sizeof
(
SVHeapAllocator
)
);
pma
=
(
SMemAllocator
*
)
calloc
(
1
,
msize
);
if
(
pma
==
NULL
)
{
return
NULL
;
}
pma
->
impl
=
POINTER_SHIFT
(
pma
,
sizeof
(
*
pma
));
pva
=
(
SVMemAllocator
*
)(
pma
->
impl
);
pva
->
type
=
type
;
pva
->
tsize
=
tsize
;
if
(
type
==
VNODE_HEAP_ALLOCATOR
)
{
pma
->
malloc
=
NULL
;
pma
->
calloc
=
NULL
;
pma
->
realloc
=
NULL
;
pma
->
free
=
NULL
;
pma
->
usage
=
NULL
;
}
else
if
(
type
==
VNODE_ARENA_ALLOCATOR
)
{
pma
->
malloc
=
NULL
;
pma
->
calloc
=
NULL
;
pma
->
realloc
=
NULL
;
pma
->
free
=
NULL
;
pma
->
usage
=
NULL
;
}
else
{
ASSERT
(
0
);
}
/* TODO */
return
NULL
;
}
void
vhaDestroy
(
SMemAllocator
*
pma
)
{
/* TODO */
}
static
void
*
vhaMalloc
(
SMemAllocator
*
pma
,
uint64_t
size
)
{
SVHeapAllocator
*
pvha
=
(
SVHeapAllocator
*
)(
pma
->
impl
);
/* TODO */
return
NULL
;
return
pma
;
}
static
void
*
vhaCalloc
(
SMemAllocator
*
pma
,
size_t
nmemb
,
uint64_t
size
)
{
// todo
return
NULL
;
void
vnodeDestroyMemAllocator
(
SMemAllocator
*
pma
)
{
// TODO
}
static
void
*
vhaRealloc
(
SMemAllocator
*
pma
,
void
*
ptr
,
uint64_t
size
)
{
/* TODO */
return
NULL
;
void
vnodeRefMemAllocator
(
SMemAllocator
*
pma
)
{
// TODO
}
static
void
vhaFree
(
SMemAllocator
*
pma
,
void
*
ptr
)
{
/* TODO */
void
vnodeUnrefMemAllocator
(
SMemAllocator
*
pma
)
{
// TODO
}
static
uint64_t
vhaUsage
(
SMemAllocator
*
pma
)
{
/* TODO */
return
0
;
}
/* ------------------------ Heap Allocator IMPL ------------------------ */
/* ------------------------ Arena Allocator IMPL ------------------------ */
\ No newline at end of file
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录