From e1a2354220c369bd5a62d255acc42c60cd14c473 Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Thu, 9 Aug 2018 00:53:25 -0700 Subject: [PATCH] [atomic] More --- src/hb-atomic-private.hh | 2 -- src/hb-object-private.hh | 7 +++++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/hb-atomic-private.hh b/src/hb-atomic-private.hh index 276e696b4..297c64698 100644 --- a/src/hb-atomic-private.hh +++ b/src/hb-atomic-private.hh @@ -274,8 +274,6 @@ struct hb_atomic_ptr_t 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 T* operator -> (void) const { return get (); } - mutable T *v; }; diff --git a/src/hb-object-private.hh b/src/hb-object-private.hh index f5d78e550..4955a68dc 100644 --- a/src/hb-object-private.hh +++ b/src/hb-object-private.hh @@ -312,10 +312,13 @@ template static inline void *hb_object_get_user_data (Type *obj, 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; 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); }