From 9643d77086b1d0896cb4703f48b71743044880bf Mon Sep 17 00:00:00 2001 From: Garret Rieger Date: Fri, 24 Sep 2021 11:39:59 -0700 Subject: [PATCH] [repacker] add more detailed comment about virtual links. --- src/hb-serialize.hh | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/hb-serialize.hh b/src/hb-serialize.hh index ece4d92a9..57689916f 100644 --- a/src/hb-serialize.hh +++ b/src/hb-serialize.hh @@ -358,10 +358,16 @@ struct hb_serialize_context_t assert (packed.tail ()->head == tail); } + // Adds a virtual link from the current object to objidx. A virtual link is not associated with + // an actual offset field. They are solely used to enforce ordering constraints between objects. + // Adding a virtual link from object a to object b will ensure that object b is always packed after + // object a in the final serialized order. + // + // This is useful in certain situtations where there needs to be a specific ordering in the + // final serialization. Such as when platform bugs require certain orderings, or to provide + // guidance to the repacker for better offset overflow resolution. void add_virtual_link (objidx_t objidx) { - // This link is not associated with an actual offset and exists merely to enforce - // an ordering constraint. if (unlikely (in_error ())) return; if (!objidx)