Skip to content
项目
群组
代码片段
帮助
正在加载...
登录
切换导航
F
freeswitch
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
张华
freeswitch
Commits
f0afe29c
提交
f0afe29c
authored
3月 24, 2017
作者:
Shane Bryldt
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
FS-10167: Temporary commit to test some weirdness with pool freeing and memory mapping
上级
130dba89
隐藏空白字符变更
内嵌
并排
正在显示
3 个修改的文件
包含
13 行增加
和
7 行删除
+13
-7
ks_pool.c
libs/libks/src/ks_pool.c
+5
-1
ks_thread.c
libs/libks/src/ks_thread.c
+4
-4
testthreadmutex.c
libs/libks/test/testthreadmutex.c
+4
-2
没有找到文件。
libs/libks/src/ks_pool.c
浏览文件 @
f0afe29c
...
@@ -628,6 +628,10 @@ static int free_pointer(ks_pool_t *mp_p, void *addr, const unsigned long size)
...
@@ -628,6 +628,10 @@ static int free_pointer(ks_pool_t *mp_p, void *addr, const unsigned long size)
real_size
=
size
;
real_size
=
size
;
}
}
while
((
real_size
&
(
sizeof
(
void
*
)
-
1
))
>
0
)
{
real_size
++
;
}
/*
/*
* We use a specific free bits calculation here because if we are
* We use a specific free bits calculation here because if we are
* freeing 10 bytes then we will be putting it into the 8-byte free
* freeing 10 bytes then we will be putting it into the 8-byte free
...
@@ -1044,7 +1048,7 @@ static int free_mem(ks_pool_t *mp_p, void *addr)
...
@@ -1044,7 +1048,7 @@ static int free_mem(ks_pool_t *mp_p, void *addr)
fence
=
FENCE_SIZE
;
fence
=
FENCE_SIZE
;
/* now we free the pointer */
/* now we free the pointer */
ret
=
free_pointer
(
mp_p
,
addr
,
old_size
+
fence
);
ret
=
free_pointer
(
mp_p
,
addr
,
old_size
+
fence
+
PREFIX_SIZE
);
if
(
ret
!=
KS_STATUS_SUCCESS
)
{
if
(
ret
!=
KS_STATUS_SUCCESS
)
{
return
ret
;
return
ret
;
}
}
...
...
libs/libks/src/ks_thread.c
浏览文件 @
f0afe29c
...
@@ -93,9 +93,9 @@ static void ks_thread_cleanup(ks_pool_t *mpool, void *ptr, void *arg, int type,
...
@@ -93,9 +93,9 @@ static void ks_thread_cleanup(ks_pool_t *mpool, void *ptr, void *arg, int type,
break
;
break
;
case
KS_MPCL_DESTROY
:
case
KS_MPCL_DESTROY
:
#ifdef WIN32
#ifdef WIN32
if
(
!
(
thread
->
flags
&
KS_THREAD_FLAG_DETATCHED
))
{
//
if (!(thread->flags & KS_THREAD_FLAG_DETATCHED)) {
CloseHandle
(
thread
->
handle
);
CloseHandle
(
thread
->
handle
);
}
//
}
#endif
#endif
break
;
break
;
}
}
...
@@ -170,7 +170,7 @@ KS_DECLARE(int) ks_thread_set_priority(int nice_val)
...
@@ -170,7 +170,7 @@ KS_DECLARE(int) ks_thread_set_priority(int nice_val)
KS_DECLARE
(
uint8_t
)
ks_thread_priority
(
ks_thread_t
*
thread
)
{
KS_DECLARE
(
uint8_t
)
ks_thread_priority
(
ks_thread_t
*
thread
)
{
uint8_t
priority
=
0
;
uint8_t
priority
=
0
;
#ifdef WIN32
#ifdef WIN32
DWORD
pri
=
GetThreadPriority
(
thread
->
handle
);
int
pri
=
GetThreadPriority
(
thread
->
handle
);
if
(
pri
>=
THREAD_PRIORITY_TIME_CRITICAL
)
{
if
(
pri
>=
THREAD_PRIORITY_TIME_CRITICAL
)
{
priority
=
99
;
priority
=
99
;
...
@@ -241,7 +241,7 @@ KS_DECLARE(ks_status_t) ks_thread_create_ex(ks_thread_t **rthread, ks_thread_fun
...
@@ -241,7 +241,7 @@ KS_DECLARE(ks_status_t) ks_thread_create_ex(ks_thread_t **rthread, ks_thread_fun
}
}
if
(
flags
&
KS_THREAD_FLAG_DETATCHED
)
{
if
(
flags
&
KS_THREAD_FLAG_DETATCHED
)
{
CloseHandle
(
thread
->
handle
);
//
CloseHandle(thread->handle);
}
}
status
=
KS_STATUS_SUCCESS
;
status
=
KS_STATUS_SUCCESS
;
...
...
libs/libks/test/testthreadmutex.c
浏览文件 @
f0afe29c
...
@@ -321,12 +321,14 @@ static void test_non_recursive_mutex(void)
...
@@ -321,12 +321,14 @@ static void test_non_recursive_mutex(void)
int
main
(
int
argc
,
char
**
argv
)
int
main
(
int
argc
,
char
**
argv
)
{
{
ks_init
();
ks_init
();
cpu_count
=
ks_cpu_count
()
*
4
;
//cpu_count = ks_cpu_count() * 4;
//cpu_count = ks_cpu_count();
cpu_count
=
1
;
plan
(
21
+
cpu_count
*
6
);
plan
(
21
+
cpu_count
*
6
);
diag
(
"Starting testing for %d tests
\n
"
,
44
);
diag
(
"Starting testing for %d tests
\n
"
,
21
+
cpu_count
*
6
);
create_pool
();
create_pool
();
create_mutex
();
create_mutex
();
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论