[serialize] Start implementing linking
authorBehdad Esfahbod <behdad@behdad.org>
Sun, 31 Mar 2019 02:49:56 +0000 (19:49 -0700)
committerBehdad Esfahbod <behdad@behdad.org>
Sun, 31 Mar 2019 02:49:56 +0000 (19:49 -0700)
src/hb-serialize.hh

index 4de87d8..ab07080 100644 (file)
@@ -143,9 +143,13 @@ struct hb_serialize_context_t
     assert (current.length == 1);
 
     /* Only "pack" if there exist other objects... Otherwise, don't bother.
-     * Saves a copy. */
-    if (packed.length > 1)
-      pop_pack ();
+     * Saves a move. */
+    if (packed.length == 1)
+      return;
+
+    pop_pack ();
+
+    link ();
   }
 
   template <typename Type>
@@ -214,6 +218,11 @@ struct hb_serialize_context_t
     assert (packed.tail ().head == tail);
   }
 
+  void link ()
+  {
+    // XXX
+  }
+
   unsigned int length () const { return this->head - current.tail ().head; }
 
   void align (unsigned int alignment)