Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Third Party Harfbuzz
提交
98816502
T
Third Party Harfbuzz
项目概览
OpenHarmony
/
Third Party Harfbuzz
接近 2 年 前同步成功
通知
1
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看板
提交
98816502
编写于
2月 25, 2016
作者:
B
Behdad Esfahbod
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Disable internal buffer variable bookkeeping in NDEBUG builds
Saves some sweet time and binary size!
上级
94dd0bb7
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
25 addition
and
12 deletion
+25
-12
src/Makefile.am
src/Makefile.am
+1
-0
src/hb-buffer-private.hh
src/hb-buffer-private.hh
+20
-10
src/hb-buffer.cc
src/hb-buffer.cc
+4
-2
未找到文件。
src/Makefile.am
浏览文件 @
98816502
...
...
@@ -130,6 +130,7 @@ pkgconfig_DATA = harfbuzz.pc
EXTRA_DIST
+=
harfbuzz.pc.in
FUZZING_CPPFLAGS
=
\
-DNDEBUG
\
-DHB_MAX_NESTING_LEVEL
=
3
\
-DHB_SANITIZE_MAX_EDITS
=
3
\
-DHB_BUFFER_MAX_EXPANSION_FACTOR
=
3
\
...
...
src/hb-buffer-private.hh
浏览文件 @
98816502
...
...
@@ -112,10 +112,6 @@ struct hb_buffer_t {
unsigned
int
serial
;
/* These reflect current allocations of the bytes in glyph_info_t's var1 and var2. */
uint8_t
allocated_var_bytes
[
8
];
const
char
*
allocated_var_owner
[
8
];
/* Text before / after the main buffer contents.
* Always in Unicode, and ordered outward.
* Index 0 is for "pre-context", 1 for "post-context". */
...
...
@@ -123,11 +119,24 @@ struct hb_buffer_t {
hb_codepoint_t
context
[
2
][
CONTEXT_LENGTH
];
unsigned
int
context_len
[
2
];
/* Debugging */
/* Debugging
API
*/
hb_buffer_message_func_t
message_func
;
void
*
message_data
;
hb_destroy_func_t
message_destroy
;
#ifndef NDEBUG
/* Internal debugging. */
/* These reflect current allocations of the bytes in glyph_info_t's var1 and var2. */
uint8_t
allocated_var_bytes
[
8
];
const
char
*
allocated_var_owner
[
8
];
HB_INTERNAL
void
allocate_var
(
unsigned
int
byte_i
,
unsigned
int
count
,
const
char
*
owner
);
HB_INTERNAL
void
deallocate_var
(
unsigned
int
byte_i
,
unsigned
int
count
,
const
char
*
owner
);
HB_INTERNAL
void
assert_var
(
unsigned
int
byte_i
,
unsigned
int
count
,
const
char
*
owner
);
HB_INTERNAL
void
deallocate_var_all
(
void
);
#else
inline
void
deallocate_var_all
(
void
)
{}
#endif
/* Methods */
...
...
@@ -140,11 +149,6 @@ struct hb_buffer_t {
{
return
len
-
idx
;
}
inline
unsigned
int
next_serial
(
void
)
{
return
serial
++
;
}
HB_INTERNAL
void
allocate_var
(
unsigned
int
byte_i
,
unsigned
int
count
,
const
char
*
owner
);
HB_INTERNAL
void
deallocate_var
(
unsigned
int
byte_i
,
unsigned
int
count
,
const
char
*
owner
);
HB_INTERNAL
void
assert_var
(
unsigned
int
byte_i
,
unsigned
int
count
,
const
char
*
owner
);
HB_INTERNAL
void
deallocate_var_all
(
void
);
HB_INTERNAL
void
add
(
hb_codepoint_t
codepoint
,
unsigned
int
cluster
);
HB_INTERNAL
void
add_info
(
const
hb_glyph_info_t
&
glyph_info
);
...
...
@@ -256,12 +260,18 @@ struct hb_buffer_t {
#define HB_BUFFER_XALLOCATE_VAR(b, func, var, owner) \
b->func (offsetof (hb_glyph_info_t, var) - offsetof(hb_glyph_info_t, var1), \
sizeof (b->info[0].var), owner)
#ifndef NDEBUG
#define HB_BUFFER_ALLOCATE_VAR(b, var) \
HB_BUFFER_XALLOCATE_VAR (b, allocate_var, var (), #var)
#define HB_BUFFER_DEALLOCATE_VAR(b, var) \
HB_BUFFER_XALLOCATE_VAR (b, deallocate_var, var (), #var)
#define HB_BUFFER_ASSERT_VAR(b, var) \
HB_BUFFER_XALLOCATE_VAR (b, assert_var, var (), #var)
#else
#define HB_BUFFER_ALLOCATE_VAR(b, var)
#define HB_BUFFER_DEALLOCATE_VAR(b, var)
#define HB_BUFFER_ASSERT_VAR(b, var)
#endif
#endif
/* HB_BUFFER_PRIVATE_HH */
src/hb-buffer.cc
浏览文件 @
98816502
...
...
@@ -242,11 +242,11 @@ hb_buffer_t::clear (void)
out_info
=
info
;
serial
=
0
;
memset
(
allocated_var_bytes
,
0
,
sizeof
allocated_var_bytes
);
memset
(
allocated_var_owner
,
0
,
sizeof
allocated_var_owner
);
memset
(
context
,
0
,
sizeof
context
);
memset
(
context_len
,
0
,
sizeof
context_len
);
deallocate_var_all
();
}
void
...
...
@@ -661,6 +661,7 @@ hb_buffer_t::guess_segment_properties (void)
}
#ifndef NDEBUG
static
inline
void
dump_var_allocation
(
const
hb_buffer_t
*
buffer
)
{
...
...
@@ -728,6 +729,7 @@ void hb_buffer_t::deallocate_var_all (void)
memset
(
allocated_var_bytes
,
0
,
sizeof
(
allocated_var_bytes
));
memset
(
allocated_var_owner
,
0
,
sizeof
(
allocated_var_owner
));
}
#endif
/* NDEBUG */
/* Public API */
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录