[repacker] remove VirtualOffset struct.

Make and add_virtual_link () specialization of add_link() instead.
This commit is contained in:
Garret Rieger 2021-09-23 14:45:20 -07:00
parent bc4c5341d6
commit 5bfc7d1015
2 changed files with 2 additions and 10 deletions

View File

@ -51,12 +51,6 @@ enum hb_serialize_error_t {
};
HB_MARK_AS_FLAG_T (hb_serialize_error_t);
// This is a 0 byte wide offset, used to add virtual links to the serializer object graph.
// It does not correspond to a real offset and exists soley to enforce an ordering constraint
// in the graph's packed order.
struct VirtualOffset {
};
struct hb_serialize_context_t
{
typedef unsigned objidx_t;
@ -364,7 +358,7 @@ struct hb_serialize_context_t
assert (packed.tail ()->head == tail);
}
void add_link (VirtualOffset &ofs, objidx_t objidx)
void add_virtual_link (objidx_t objidx)
{
// This link is not associated with an actual offset and exists merely to enforce
// an ordering constraint.
@ -374,7 +368,6 @@ struct hb_serialize_context_t
return;
assert (current);
assert (current->head <= (const char *) &ofs);
auto& link = *current->links.push ();
if (current->links.in_error ())

View File

@ -100,8 +100,7 @@ static void run_resolve_overflow_test (const char* name,
static void add_virtual_offset (unsigned id,
hb_serialize_context_t* c)
{
VirtualOffset* offset = c->start_embed<VirtualOffset> ();
c->add_link (*offset, id);
c->add_virtual_link (id);
}
static void