Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Third Party Harfbuzz
提交
7babfe5a
T
Third Party Harfbuzz
项目概览
OpenHarmony
/
Third Party Harfbuzz
大约 1 年 前同步成功
通知
0
Star
18
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
T
Third Party Harfbuzz
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
7babfe5a
编写于
12月 04, 2012
作者:
B
Behdad Esfahbod
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Move object mutext into the user-data array
We are not using it for anything lse it seems.
上级
a1900114
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
12 addition
and
24 deletion
+12
-24
src/hb-common.cc
src/hb-common.cc
+2
-10
src/hb-object-private.hh
src/hb-object-private.hh
+10
-14
未找到文件。
src/hb-common.cc
浏览文件 @
7babfe5a
...
...
@@ -363,8 +363,7 @@ bool
hb_user_data_array_t
::
set
(
hb_user_data_key_t
*
key
,
void
*
data
,
hb_destroy_func_t
destroy
,
hb_bool_t
replace
,
hb_mutex_t
&
lock
)
hb_bool_t
replace
)
{
if
(
!
key
)
return
false
;
...
...
@@ -382,20 +381,13 @@ hb_user_data_array_t::set (hb_user_data_key_t *key,
}
void
*
hb_user_data_array_t
::
get
(
hb_user_data_key_t
*
key
,
hb_mutex_t
&
lock
)
hb_user_data_array_t
::
get
(
hb_user_data_key_t
*
key
)
{
hb_user_data_item_t
item
=
{
NULL
};
return
items
.
find
(
key
,
&
item
,
lock
)
?
item
.
data
:
NULL
;
}
void
hb_user_data_array_t
::
finish
(
hb_mutex_t
&
lock
)
{
items
.
finish
(
lock
);
}
/* hb_version */
...
...
src/hb-object-private.hh
浏览文件 @
7babfe5a
...
...
@@ -65,7 +65,7 @@ struct hb_reference_count_t
/* user_data */
#define HB_USER_DATA_ARRAY_INIT {HB_LOCKABLE_SET_INIT}
#define HB_USER_DATA_ARRAY_INIT {HB_
MUTEX_INIT, HB_
LOCKABLE_SET_INIT}
struct
hb_user_data_array_t
{
/* TODO Add tracing. */
...
...
@@ -81,20 +81,19 @@ struct hb_user_data_array_t
void
finish
(
void
)
{
if
(
destroy
)
destroy
(
data
);
}
};
hb_mutex_t
lock
;
hb_lockable_set_t
<
hb_user_data_item_t
,
hb_mutex_t
>
items
;
inline
void
init
(
void
)
{
items
.
init
();
}
inline
void
init
(
void
)
{
lock
.
init
();
items
.
init
();
}
HB_INTERNAL
bool
set
(
hb_user_data_key_t
*
key
,
void
*
data
,
hb_destroy_func_t
destroy
,
hb_bool_t
replace
,
hb_mutex_t
&
lock
);
hb_bool_t
replace
);
HB_INTERNAL
void
*
get
(
hb_user_data_key_t
*
key
,
hb_mutex_t
&
lock
);
HB_INTERNAL
void
*
get
(
hb_user_data_key_t
*
key
);
HB_INTERNAL
void
finish
(
hb_mutex_t
&
lock
);
inline
void
finish
(
void
)
{
items
.
finish
(
lock
);
lock
.
finish
();
}
};
...
...
@@ -103,10 +102,9 @@ struct hb_user_data_array_t
struct
hb_object_header_t
{
hb_reference_count_t
ref_count
;
hb_mutex_t
mutex
;
hb_user_data_array_t
user_data
;
#define HB_OBJECT_HEADER_STATIC {HB_REFERENCE_COUNT_INVALID, HB_
MUTEX_INIT, HB_
USER_DATA_ARRAY_INIT}
#define HB_OBJECT_HEADER_STATIC {HB_REFERENCE_COUNT_INVALID, HB_USER_DATA_ARRAY_INIT}
static
inline
void
*
create
(
unsigned
int
size
)
{
hb_object_header_t
*
obj
=
(
hb_object_header_t
*
)
calloc
(
1
,
size
);
...
...
@@ -119,7 +117,6 @@ struct hb_object_header_t
inline
void
init
(
void
)
{
ref_count
.
init
(
1
);
mutex
.
init
();
user_data
.
init
();
}
...
...
@@ -140,8 +137,7 @@ struct hb_object_header_t
return
false
;
ref_count
.
finish
();
/* Do this before user_data */
user_data
.
finish
(
mutex
);
mutex
.
finish
();
user_data
.
finish
();
return
true
;
}
...
...
@@ -153,14 +149,14 @@ struct hb_object_header_t
if
(
unlikely
(
!
this
||
this
->
is_inert
()))
return
false
;
return
user_data
.
set
(
key
,
data
,
destroy_func
,
replace
,
mutex
);
return
user_data
.
set
(
key
,
data
,
destroy_func
,
replace
);
}
inline
void
*
get_user_data
(
hb_user_data_key_t
*
key
)
{
if
(
unlikely
(
!
this
||
this
->
is_inert
()))
return
NULL
;
return
user_data
.
get
(
key
,
mutex
);
return
user_data
.
get
(
key
);
}
inline
void
trace
(
const
char
*
function
)
const
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录