summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/upb_def.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/src/upb_def.c b/src/upb_def.c
index 1983be4..6bb1d0c 100644
--- a/src/upb_def.c
+++ b/src/upb_def.c
@@ -44,12 +44,13 @@ static int div_round_up(int numerator, int denominator) {
//
// The cycles in this graph are AB and ABC. When A's external refcount
// transitions from 0->1, we say that A takes "cycle references" on both
-// cycles. Since A and B are common to both cycles, A and B's cycle refcounts
-// will be incremented by two, and C's will be incremented by one. Likewise,
-// when A's external refcount transitions from 1->0, we decrement A and B's
-// cycle refcounts by two and C's by one. We collect a cyclic type when its
-// cycle refcount drops to zero. A precondition for this is that the external
-// refcount has dropped to zero also.
+// cycles. Taking a cycle reference means incrementing the cycle refcount of
+// all defs in the cycle. Since A and B are common to both cycles, A and B's
+// cycle refcounts will be incremented by two, and C's will be incremented by
+// one. Likewise, when A's external refcount transitions from 1->0, we
+// decrement A and B's cycle refcounts by two and C's by one. We collect a
+// cyclic type when its cycle refcount drops to zero. A precondition for this
+// is that the external refcount has dropped to zero also.
//
// This algorithm is relatively cheap, since it only requires extra work when
// the external refcount on a cyclic type transitions from 0->1 or 1->0.
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback