Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Third Party Harfbuzz
提交
5d801298
T
Third Party Harfbuzz
项目概览
OpenHarmony
/
Third Party Harfbuzz
12 个月 前同步成功
通知
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,发现更多精彩内容 >>
提交
5d801298
编写于
5月 24, 2018
作者:
B
Behdad Esfahbod
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Add CrapPool
Common Regoin for Access Protection. Like the NullPool, but writable.
上级
673b764d
变更
7
隐藏空白更改
内联
并排
Showing
7 changed file
with
51 addition
and
4 deletion
+51
-4
src/dump-emoji.cc
src/dump-emoji.cc
+1
-0
src/dump-fon.cc
src/dump-fon.cc
+1
-0
src/hb-open-type-private.hh
src/hb-open-type-private.hh
+11
-0
src/hb-ot-layout.cc
src/hb-ot-layout.cc
+1
-0
src/hb-private.hh
src/hb-private.hh
+35
-4
src/hb-subset.cc
src/hb-subset.cc
+1
-0
src/main.cc
src/main.cc
+1
-0
未找到文件。
src/dump-emoji.cc
浏览文件 @
5d801298
...
@@ -48,6 +48,7 @@
...
@@ -48,6 +48,7 @@
#ifndef HB_NO_VISIBILITY
#ifndef HB_NO_VISIBILITY
const
void
*
const
_hb_NullPool
[
HB_NULL_POOL_SIZE
/
sizeof
(
void
*
)]
=
{};
const
void
*
const
_hb_NullPool
[
HB_NULL_POOL_SIZE
/
sizeof
(
void
*
)]
=
{};
void
*
_hb_CrapPool
[
HB_NULL_POOL_SIZE
/
sizeof
(
void
*
)]
=
{};
#endif
#endif
void
cbdt_callback
(
const
uint8_t
*
data
,
unsigned
int
length
,
void
cbdt_callback
(
const
uint8_t
*
data
,
unsigned
int
length
,
...
...
src/dump-fon.cc
浏览文件 @
5d801298
...
@@ -28,6 +28,7 @@
...
@@ -28,6 +28,7 @@
#ifndef HB_NO_VISIBILITY
#ifndef HB_NO_VISIBILITY
const
void
*
const
_hb_NullPool
[
HB_NULL_POOL_SIZE
/
sizeof
(
void
*
)]
=
{};
const
void
*
const
_hb_NullPool
[
HB_NULL_POOL_SIZE
/
sizeof
(
void
*
)]
=
{};
void
*
_hb_CrapPool
[
HB_NULL_POOL_SIZE
/
sizeof
(
void
*
)]
=
{};
#endif
#endif
template
<
typename
Type
,
int
Bytes
>
struct
LEInt
;
template
<
typename
Type
,
int
Bytes
>
struct
LEInt
;
...
...
src/hb-open-type-private.hh
浏览文件 @
5d801298
...
@@ -932,6 +932,7 @@ struct ArrayOf
...
@@ -932,6 +932,7 @@ struct ArrayOf
}
}
inline
Type
&
operator
[]
(
unsigned
int
i
)
inline
Type
&
operator
[]
(
unsigned
int
i
)
{
{
if
(
unlikely
(
i
>=
len
))
return
Crap
(
Type
);
return
arrayZ
[
i
];
return
arrayZ
[
i
];
}
}
inline
unsigned
int
get_size
(
void
)
const
inline
unsigned
int
get_size
(
void
)
const
...
@@ -1040,6 +1041,11 @@ struct OffsetListOf : OffsetArrayOf<Type>
...
@@ -1040,6 +1041,11 @@ struct OffsetListOf : OffsetArrayOf<Type>
if
(
unlikely
(
i
>=
this
->
len
))
return
Null
(
Type
);
if
(
unlikely
(
i
>=
this
->
len
))
return
Null
(
Type
);
return
this
+
this
->
arrayZ
[
i
];
return
this
+
this
->
arrayZ
[
i
];
}
}
inline
const
Type
&
operator
[]
(
unsigned
int
i
)
{
if
(
unlikely
(
i
>=
this
->
len
))
return
Crap
(
Type
);
return
this
+
this
->
arrayZ
[
i
];
}
inline
bool
sanitize
(
hb_sanitize_context_t
*
c
)
const
inline
bool
sanitize
(
hb_sanitize_context_t
*
c
)
const
{
{
...
@@ -1064,6 +1070,11 @@ struct HeadlessArrayOf
...
@@ -1064,6 +1070,11 @@ struct HeadlessArrayOf
if
(
unlikely
(
i
>=
len
||
!
i
))
return
Null
(
Type
);
if
(
unlikely
(
i
>=
len
||
!
i
))
return
Null
(
Type
);
return
arrayZ
[
i
-
1
];
return
arrayZ
[
i
-
1
];
}
}
inline
Type
&
operator
[]
(
unsigned
int
i
)
{
if
(
unlikely
(
i
>=
len
||
!
i
))
return
Crap
(
Type
);
return
arrayZ
[
i
-
1
];
}
inline
unsigned
int
get_size
(
void
)
const
inline
unsigned
int
get_size
(
void
)
const
{
return
len
.
static_size
+
(
len
?
len
-
1
:
0
)
*
Type
::
static_size
;
}
{
return
len
.
static_size
+
(
len
?
len
-
1
:
0
)
*
Type
::
static_size
;
}
...
...
src/hb-ot-layout.cc
浏览文件 @
5d801298
...
@@ -48,6 +48,7 @@
...
@@ -48,6 +48,7 @@
#ifndef HB_NO_VISIBILITY
#ifndef HB_NO_VISIBILITY
const
void
*
const
_hb_NullPool
[
HB_NULL_POOL_SIZE
/
sizeof
(
void
*
)]
=
{};
const
void
*
const
_hb_NullPool
[
HB_NULL_POOL_SIZE
/
sizeof
(
void
*
)]
=
{};
void
*
_hb_CrapPool
[
HB_NULL_POOL_SIZE
/
sizeof
(
void
*
)]
=
{};
#endif
#endif
...
...
src/hb-private.hh
浏览文件 @
5d801298
...
@@ -529,7 +529,7 @@ _hb_ceil_to_4 (unsigned int v)
...
@@ -529,7 +529,7 @@ _hb_ceil_to_4 (unsigned int v)
*/
*/
/*
/*
*
Null object
s
*
Static pool
s
*/
*/
/* Global nul-content Null pool. Enlarge as necessary. */
/* Global nul-content Null pool. Enlarge as necessary. */
...
@@ -547,7 +547,6 @@ const void * const _hb_NullPool[HB_NULL_POOL_SIZE / sizeof (void *)]
...
@@ -547,7 +547,6 @@ const void * const _hb_NullPool[HB_NULL_POOL_SIZE / sizeof (void *)]
=
{}
=
{}
#endif
#endif
;
;
/* Generic nul-content Null objects. */
/* Generic nul-content Null objects. */
template
<
typename
Type
>
template
<
typename
Type
>
static
inline
const
Type
&
Null
(
void
)
{
static
inline
const
Type
&
Null
(
void
)
{
...
@@ -569,6 +568,28 @@ namespace Namespace { \
...
@@ -569,6 +568,28 @@ namespace Namespace { \
static_assert (Namespace::Type::min_size + 1 <= sizeof (_Null##Type), "Null pool too small. Enlarge.")
static_assert (Namespace::Type::min_size + 1 <= sizeof (_Null##Type), "Null pool too small. Enlarge.")
/* Global writable pool. Enlarge as necessary. */
#ifdef HB_NO_VISIBILITY
static
#else
extern
HB_INTERNAL
#endif
void
*
_hb_CrapPool
[
HB_NULL_POOL_SIZE
/
sizeof
(
void
*
)]
#ifdef HB_NO_VISIBILITY
=
{}
#endif
;
/* CRAP pool: Common Region for Access Protection. */
template
<
typename
Type
>
static
inline
Type
&
Crap
(
void
)
{
static_assert
(
sizeof
(
Type
)
<=
HB_NULL_POOL_SIZE
,
"Increase HB_NULL_POOL_SIZE."
);
Type
*
obj
=
reinterpret_cast
<
Type
*>
(
_hb_CrapPool
);
*
obj
=
Null
(
Type
);
return
*
obj
;
}
#define Crap(Type) Crap<Type>()
/* arrays and maps */
/* arrays and maps */
...
@@ -589,8 +610,18 @@ struct hb_vector_t
...
@@ -589,8 +610,18 @@ struct hb_vector_t
arrayZ
=
static_array
;
arrayZ
=
static_array
;
}
}
inline
Type
&
operator
[]
(
unsigned
int
i
)
{
return
arrayZ
[
i
];
}
inline
Type
&
operator
[]
(
unsigned
int
i
)
inline
const
Type
&
operator
[]
(
unsigned
int
i
)
const
{
return
arrayZ
[
i
];
}
{
if
(
unlikely
(
i
>=
len
))
return
Crap
(
Type
);
return
arrayZ
[
i
];
}
inline
const
Type
&
operator
[]
(
unsigned
int
i
)
const
{
if
(
unlikely
(
i
>=
len
))
return
Null
(
Type
);
return
arrayZ
[
i
];
}
inline
Type
*
push
(
void
)
inline
Type
*
push
(
void
)
{
{
...
...
src/hb-subset.cc
浏览文件 @
5d801298
...
@@ -46,6 +46,7 @@
...
@@ -46,6 +46,7 @@
#if !defined(HB_NO_VISIBILITY) && !defined(HB_SUBSET_BUILTIN)
#if !defined(HB_NO_VISIBILITY) && !defined(HB_SUBSET_BUILTIN)
const
void
*
const
_hb_NullPool
[
HB_NULL_POOL_SIZE
/
sizeof
(
void
*
)]
=
{};
const
void
*
const
_hb_NullPool
[
HB_NULL_POOL_SIZE
/
sizeof
(
void
*
)]
=
{};
void
*
_hb_CrapPool
[
HB_NULL_POOL_SIZE
/
sizeof
(
void
*
)]
=
{};
#endif
#endif
...
...
src/main.cc
浏览文件 @
5d801298
...
@@ -39,6 +39,7 @@ using namespace OT;
...
@@ -39,6 +39,7 @@ using namespace OT;
#ifndef HB_NO_VISIBILITY
#ifndef HB_NO_VISIBILITY
const
void
*
const
_hb_NullPool
[
HB_NULL_POOL_SIZE
/
sizeof
(
void
*
)]
=
{};
const
void
*
const
_hb_NullPool
[
HB_NULL_POOL_SIZE
/
sizeof
(
void
*
)]
=
{};
void
*
_hb_CrapPool
[
HB_NULL_POOL_SIZE
/
sizeof
(
void
*
)]
=
{};
#endif
#endif
int
int
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录