[atomic] More
This commit is contained in:
parent
f1f4b45ac3
commit
e1a2354220
|
@ -274,8 +274,6 @@ struct hb_atomic_ptr_t
|
||||||
inline T *get (void) const { return (T *) hb_atomic_ptr_impl_get ((void **) &v); }
|
inline T *get (void) const { return (T *) hb_atomic_ptr_impl_get ((void **) &v); }
|
||||||
inline bool cmpexch (const T *old, T *new_) const{ return hb_atomic_ptr_impl_cmpexch (&v, old, new_); }
|
inline bool cmpexch (const T *old, T *new_) const{ return hb_atomic_ptr_impl_cmpexch (&v, old, new_); }
|
||||||
|
|
||||||
inline T* operator -> (void) const { return get (); }
|
|
||||||
|
|
||||||
mutable T *v;
|
mutable T *v;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -312,10 +312,13 @@ template <typename Type>
|
||||||
static inline void *hb_object_get_user_data (Type *obj,
|
static inline void *hb_object_get_user_data (Type *obj,
|
||||||
hb_user_data_key_t *key)
|
hb_user_data_key_t *key)
|
||||||
{
|
{
|
||||||
if (unlikely (!obj || hb_object_is_inert (obj) || !obj->header.user_data.get ()))
|
if (unlikely (!obj || hb_object_is_inert (obj)))
|
||||||
return nullptr;
|
return nullptr;
|
||||||
assert (hb_object_is_valid (obj));
|
assert (hb_object_is_valid (obj));
|
||||||
return obj->header.user_data->get (key);
|
hb_user_data_array_t *user_data = obj->header.user_data.get ();
|
||||||
|
if (!user_data)
|
||||||
|
return nullptr;
|
||||||
|
return user_data->get (key);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue