提交 7a8d4803 编写于 作者: B Behdad Esfahbod

[lazy] Add .free()

上级 c7ca30a5
...@@ -454,7 +454,7 @@ static struct hb_ft_font_funcs_lazy_loader_t : hb_font_funcs_lazy_loader_t<hb_ft ...@@ -454,7 +454,7 @@ static struct hb_ft_font_funcs_lazy_loader_t : hb_font_funcs_lazy_loader_t<hb_ft
static static
void free_static_ft_funcs (void) void free_static_ft_funcs (void)
{ {
static_ft_funcs.fini (); static_ft_funcs.free ();
} }
#endif #endif
......
...@@ -394,7 +394,7 @@ static struct hb_glib_unicode_funcs_lazy_loader_t : hb_unicode_funcs_lazy_loader ...@@ -394,7 +394,7 @@ static struct hb_glib_unicode_funcs_lazy_loader_t : hb_unicode_funcs_lazy_loader
static static
void free_static_glib_funcs (void) void free_static_glib_funcs (void)
{ {
static_glib_funcs.fini (); static_glib_funcs.free ();
} }
#endif #endif
......
...@@ -373,7 +373,7 @@ static struct hb_icu_unicode_funcs_lazy_loader_t : hb_unicode_funcs_lazy_loader_ ...@@ -373,7 +373,7 @@ static struct hb_icu_unicode_funcs_lazy_loader_t : hb_unicode_funcs_lazy_loader_
static static
void free_static_icu_funcs (void) void free_static_icu_funcs (void)
{ {
static_icu_funcs.fini (); static_icu_funcs.free ();
} }
#endif #endif
......
...@@ -627,6 +627,10 @@ struct hb_lazy_loader_t : hb_data_wrapper_t<Data, WheresData> ...@@ -627,6 +627,10 @@ struct hb_lazy_loader_t : hb_data_wrapper_t<Data, WheresData>
inline void init0 (void) {} /* Init, when memory is already set to 0. No-op for us. */ inline void init0 (void) {} /* Init, when memory is already set to 0. No-op for us. */
inline void init (void) { instance.set_relaxed (nullptr); } inline void init (void) { instance.set_relaxed (nullptr); }
inline void fini (void) inline void fini (void)
{
do_destroy (instance.get ());
}
inline void free (void)
{ {
retry: retry:
Stored *p = instance.get (); Stored *p = instance.get ();
......
...@@ -264,7 +264,7 @@ static struct hb_ot_font_funcs_lazy_loader_t : hb_font_funcs_lazy_loader_t<hb_ot ...@@ -264,7 +264,7 @@ static struct hb_ot_font_funcs_lazy_loader_t : hb_font_funcs_lazy_loader_t<hb_ot
static static
void free_static_ot_funcs (void) void free_static_ot_funcs (void)
{ {
static_ot_funcs.fini (); static_ot_funcs.free ();
} }
#endif #endif
......
...@@ -267,7 +267,7 @@ static struct hb_ucdn_unicode_funcs_lazy_loader_t : hb_unicode_funcs_lazy_loader ...@@ -267,7 +267,7 @@ static struct hb_ucdn_unicode_funcs_lazy_loader_t : hb_unicode_funcs_lazy_loader
static static
void free_static_ucdn_funcs (void) void free_static_ucdn_funcs (void)
{ {
static_ucdn_funcs.fini (); static_ucdn_funcs.free ();
} }
#endif #endif
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册