[serialize] Start implementing linking

This commit is contained in:
Behdad Esfahbod 2019-03-30 19:49:56 -07:00
parent 313b3057c3
commit d6005b49b3
1 changed files with 12 additions and 3 deletions

View 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)