mirror of
https://github.com/storytold/harfbuzz.git
synced 2026-11-20 22:41:10 +01:00
[serialize] Support zerocopy while sharing
This commit is contained in:
1 parent
44a5de3a97
commit
071a2bb4f7
1 file changed
+3
-6
+3
-6
@@ -348,8 +348,8 @@ struct hb_serialize_context_t
|
||||
assert (obj->head <= obj->tail);
|
||||
unsigned len = obj->tail - obj->head;
|
||||
head = zerocopy ? zerocopy : obj->head; /* Rewind head. */
|
||||
if (zerocopy)
|
||||
assert (!share);
|
||||
bool was_zerocopy = zerocopy;
|
||||
zerocopy = nullptr;
|
||||
|
||||
if (!len)
|
||||
{
|
||||
@@ -373,11 +373,8 @@ struct hb_serialize_context_t
|
||||
}
|
||||
|
||||
tail -= len;
|
||||
if (zerocopy)
|
||||
{
|
||||
zerocopy = nullptr;
|
||||
if (was_zerocopy)
|
||||
assert (tail == obj->head);
|
||||
}
|
||||
else
|
||||
memmove (tail, obj->head, len);
|
||||
|
||||
|
||||
Reference in new issue
Block a user