Remove constructor from hb_prealloced_array_t

This was causing all object types to be non-POD and have static
initializers.  We don't need that!

Now, most nil objects just moved from .bss to .data.  Fixing for that
coming soon.
This commit is contained in:
Behdad Esfahbod 2012-06-05 14:17:32 -04:00
parent 7037291aac
commit bf93b636c4
3 changed files with 7 additions and 1 deletions

View File

@ -80,6 +80,8 @@ struct hb_user_data_array_t
hb_lockable_set_t<hb_user_data_item_t, hb_static_mutex_t> items;
inline void init (void) { items.init (); }
HB_INTERNAL bool set (hb_user_data_key_t *key,
void * data,
hb_destroy_func_t destroy,
@ -111,6 +113,7 @@ struct hb_object_header_t
inline void init (void) {
ref_count.init (1);
user_data.init ();
}
inline bool is_inert (void) const {

View File

@ -247,7 +247,7 @@ struct hb_prealloced_array_t {
Type *array;
Type static_array[StaticSize];
hb_prealloced_array_t (void) { memset (this, 0, sizeof (*this)); }
void init (void) { memset (this, 0, sizeof (*this)); }
inline Type& operator [] (unsigned int i) { return array[i]; }
inline const Type& operator [] (unsigned int i) const { return array[i]; }
@ -351,6 +351,8 @@ struct hb_lockable_set_t
{
hb_array_t <item_t> items;
inline void init (void) { items.init (); }
template <typename T>
inline item_t *replace_or_insert (T v, lock_t &l, bool replace)
{

View File

@ -37,6 +37,7 @@
struct _hb_set_t
{
inline void init (void) {
header.init ();
clear ();
}
inline void fini (void) {