summaryrefslogtreecommitdiff
path: root/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-object-private.hh
diff options
context:
space:
mode:
authorAkira Kakuto <kakuto@fuk.kindai.ac.jp>2017-11-15 04:57:26 +0000
committerAkira Kakuto <kakuto@fuk.kindai.ac.jp>2017-11-15 04:57:26 +0000
commit6a5dae5408627dd0a1b37272f939e18f6ff50424 (patch)
tree7034de9753204f7b9d6ae346fcf5a94763eebf20 /Build/source/libs/harfbuzz/harfbuzz-src/src/hb-object-private.hh
parent4b4ed766bfdfe3a5e18e1a7547d37f94383d6a6b (diff)
harfbuzz-1.7.1
git-svn-id: svn://tug.org/texlive/trunk@45817 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build/source/libs/harfbuzz/harfbuzz-src/src/hb-object-private.hh')
-rw-r--r--Build/source/libs/harfbuzz/harfbuzz-src/src/hb-object-private.hh37
1 files changed, 6 insertions, 31 deletions
diff --git a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-object-private.hh b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-object-private.hh
index 0dada492c94..baa1f8f05cc 100644
--- a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-object-private.hh
+++ b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-object-private.hh
@@ -41,10 +41,9 @@
/* reference_count */
-#define HB_REFERENCE_COUNT_UNCHANGABLE_VALUE -0x53043
-#define HB_REFERENCE_COUNT_UNREFFABLE_VALUE -0x07734
-#define HB_REFERENCE_COUNT_UNTOUCHABLE_VALUE -0xBEDAD
-#define HB_REFERENCE_COUNT_INIT {HB_ATOMIC_INT_INIT (HB_REFERENCE_COUNT_UNCHANGABLE_VALUE)}
+#define HB_REFERENCE_COUNT_INERT_VALUE -1
+#define HB_REFERENCE_COUNT_POISON_VALUE -0x0000DEAD
+#define HB_REFERENCE_COUNT_INIT {HB_ATOMIC_INT_INIT(HB_REFERENCE_COUNT_INERT_VALUE)}
struct hb_reference_count_t
{
@@ -54,23 +53,9 @@ struct hb_reference_count_t
inline int get_unsafe (void) const { return ref_count.get_unsafe (); }
inline int inc (void) { return ref_count.inc (); }
inline int dec (void) { return ref_count.dec (); }
- inline void finish (void) { ref_count.set_unsafe (HB_REFERENCE_COUNT_UNTOUCHABLE_VALUE); }
-
- inline void make_inert (void)
- {
- if (get_unsafe () == HB_REFERENCE_COUNT_UNCHANGABLE_VALUE)
- return;
- ref_count.set_unsafe (HB_REFERENCE_COUNT_UNREFFABLE_VALUE);
- }
- inline void undo_inert (void)
- {
- if (get_unsafe () == HB_REFERENCE_COUNT_UNCHANGABLE_VALUE)
- return;
- assert (get_unsafe () == HB_REFERENCE_COUNT_UNREFFABLE_VALUE);
- ref_count.set_unsafe (1);
- }
-
- inline bool is_inert (void) const { return ref_count.get_unsafe () < 0; }
+ inline void finish (void) { ref_count.set_unsafe (HB_REFERENCE_COUNT_POISON_VALUE); }
+
+ inline bool is_inert (void) const { return ref_count.get_unsafe () == HB_REFERENCE_COUNT_INERT_VALUE; }
inline bool is_valid (void) const { return ref_count.get_unsafe () > 0; }
};
@@ -161,16 +146,6 @@ static inline bool hb_object_is_valid (const Type *obj)
return likely (obj->header.ref_count.is_valid ());
}
template <typename Type>
-static inline void hb_object_make_inert (Type *obj)
-{
- obj->header.ref_count.make_inert ();
-}
-template <typename Type>
-static inline void hb_object_undo_inert (Type *obj)
-{
- obj->header.ref_count.undo_inert ();
-}
-template <typename Type>
static inline Type *hb_object_reference (Type *obj)
{
hb_object_trace (obj, HB_FUNC);