[atomic] Clean up atomic_ptr_t

This commit is contained in:
Behdad Esfahbod committed 2025-03-12 18:19:04 -06:00
1 parent a0d76c5b37
commit 829d1eda16
3 files changed
+4 -6

No files matched your search

+2 -4
View File
@@ -184,11 +184,9 @@ struct hb_atomic_t
T v = 0;
};
template <typename P>
struct hb_atomic_t<P*>
template <typename T>
struct hb_atomic_t<T*>
{
typedef hb_remove_pointer<P> T;
hb_atomic_t () = default;
constexpr hb_atomic_t (T* v) : v (v) {}
hb_atomic_t (const hb_atomic_t &other) = delete;
+1 -1
View File
@@ -403,7 +403,7 @@ hb_language_to_string (hb_language_t language)
hb_language_t
hb_language_get_default ()
{
static hb_atomic_ptr_t <hb_language_t> default_language;
static hb_atomic_ptr_t <const hb_language_impl_t> default_language;
hb_language_t language = default_language;
if (unlikely (language == HB_LANGUAGE_INVALID))
+1 -1
View File
@@ -273,7 +273,7 @@ struct hb_lazy_loader_t : hb_data_wrapper_t<Data, WheresData>
private:
/* Must only have one pointer. */
hb_atomic_ptr_t<Stored *> instance;
hb_atomic_ptr_t<Stored> instance;
};
/* Specializations. */