Change null-pool specialization to min_size again

This commit is contained in:
Behdad Esfahbod 2018-08-06 05:29:15 -07:00
parent 25147ff808
commit f9cfa5cb0e
1 changed files with 4 additions and 4 deletions

View File

@ -49,19 +49,19 @@ static inline Type const & Null (void) {
}
#define Null(Type) Null<Type>()
/* Specializaiton for arbitrary-content arbitrary-sized Null objects. */
/* Specializaitons for arbitrary-content Null objects expressed in bytes. */
#define DECLARE_NULL_NAMESPACE_BYTES(Namespace, Type) \
} /* Close namespace. */ \
extern HB_INTERNAL const unsigned char _hb_Null_##Namespace##_##Type[sizeof (Namespace::Type)]; \
extern HB_INTERNAL const unsigned char _hb_Null_##Namespace##_##Type[Namespace::Type::min_size]; \
template <> \
/*static*/ inline const Namespace::Type& Null<Namespace::Type> (void) { \
return *reinterpret_cast<const Namespace::Type *> (_hb_Null_##Namespace##_##Type); \
} \
namespace Namespace { \
static_assert (Namespace::Type::min_size <= sizeof (Type), "Null pool too small. Enlarge."); \
static_assert (true, "Just so we take semicolon after.")
#define DEFINE_NULL_NAMESPACE_BYTES(Namespace, Type) \
const unsigned char _hb_Null_##Namespace##_##Type[sizeof (Namespace::Type)]
const unsigned char _hb_Null_##Namespace##_##Type[Namespace::Type::min_size]
/* Global writable pool. Enlarge as necessary. */