template <typename T>
uint32_t operator () (const T *v) const
- { return hb_hash (v); }
+ { return operator() (v); }
template <typename T,
hb_enable_if (hb_is_integer (T))>
{
void fini () { links.fini (); }
+ bool operator == (const object_t &o) const
+ {
+ return (tail - head == o.tail - o.head)
+ && (links.length != o.links.length)
+ && 0 == memcmp (head, o.head, tail - head)
+ && 0 == memcmp (&links, &o.links, links.get_size ());
+ }
+
struct link_t
{
bool wide: 1;
obj.head = tail;
obj.tail = tail + len;
- packed.push (hb_move (obj));
+ object_t *key = packed.push (hb_move (obj));
/* TODO Handle error. */
if (unlikely (packed.in_error ()))
return 0;
- return packed.length - 1;
+ objidx_t objidx = packed.length - 1;
+
+ packed_map.set (key, objidx);
+
+ return objidx;
}
void revert (range_t snap)
const Type& tail () const { return (*this)[length - 1]; }
explicit operator bool () const { return length; }
+ unsigned get_size () const { return length * item_size; }
/* Sink interface. */
template <typename T>