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:
parent
7037291aac
commit
bf93b636c4
|
@ -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 {
|
||||
|
|
|
@ -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)
|
||||
{
|
||||
|
|
|
@ -37,6 +37,7 @@
|
|||
struct _hb_set_t
|
||||
{
|
||||
inline void init (void) {
|
||||
header.init ();
|
||||
clear ();
|
||||
}
|
||||
inline void fini (void) {
|
||||
|
|
Loading…
Reference in New Issue