Use NullPool for _hb_set_nil and _hb_map_nil

This commit is contained in:
Behdad Esfahbod 2018-05-31 20:20:17 -07:00
parent f040ca40ab
commit 7b50bf52f2
3 changed files with 3 additions and 19 deletions

View File

@ -50,16 +50,6 @@ hb_map_create (void)
return map;
}
static const hb_map_t _hb_map_nil = {
HB_OBJECT_HEADER_STATIC,
false, /* successful */
0, /* population */
0, /* occupancy */
0, /* mask */
0, /* prime */
nullptr /* items */
};
/**
* hb_map_get_empty:
*
@ -70,7 +60,7 @@ static const hb_map_t _hb_map_nil = {
hb_map_t *
hb_map_get_empty (void)
{
return const_cast<hb_map_t *> (&_hb_map_nil);
return const_cast<hb_map_t *> (&Null(hb_map_t));
}
/**

View File

@ -545,7 +545,7 @@ _hb_ceil_to_4 (unsigned int v)
/* Global nul-content Null pool. Enlarge as necessary. */
#define HB_NULL_POOL_SIZE 264
#define HB_NULL_POOL_SIZE 384
static_assert (HB_NULL_POOL_SIZE % sizeof (void *) == 0, "Align HB_NULL_POOL_SIZE.");
#ifdef HB_NO_VISIBILITY

View File

@ -50,12 +50,6 @@ hb_set_create (void)
return set;
}
static const hb_set_t _hb_set_nil = {
HB_OBJECT_HEADER_STATIC,
false, /* successful */
0, /* population */
};
/**
* hb_set_get_empty:
*
@ -66,7 +60,7 @@ static const hb_set_t _hb_set_nil = {
hb_set_t *
hb_set_get_empty (void)
{
return const_cast<hb_set_t *> (&_hb_set_nil);
return const_cast<hb_set_t *> (&Null(hb_set_t));
}
/**