summaryrefslogtreecommitdiff
path: root/src/hb-dsalgs.hh
diff options
context:
space:
mode:
authorBehdad Esfahbod <behdad@behdad.org>2018-08-24 10:07:49 -0700
committerBehdad Esfahbod <behdad@behdad.org>2018-08-24 10:07:49 -0700
commit142ac5a6be6088771e0ee4b135ba753c80036a9a (patch)
tree7804c3678e5dfdd16415bf035f85ce919018344c /src/hb-dsalgs.hh
parent1c6b3693245d38103cab224d75262d45dc88c71c (diff)
[serialize] Add copy_bytes() and copy_blob()
Diffstat (limited to 'src/hb-dsalgs.hh')
-rw-r--r--src/hb-dsalgs.hh3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/hb-dsalgs.hh b/src/hb-dsalgs.hh
index 8cbe6584..8d59c6cf 100644
--- a/src/hb-dsalgs.hh
+++ b/src/hb-dsalgs.hh
@@ -502,6 +502,9 @@ struct hb_bytes_t
{
inline hb_bytes_t (void) : bytes (nullptr), len (0) {}
inline hb_bytes_t (const char *bytes_, unsigned int len_) : bytes (bytes_), len (len_) {}
+ inline hb_bytes_t (const void *bytes_, unsigned int len_) : bytes ((const char *) bytes_), len (len_) {}
+
+ inline void free (void) { ::free ((void *) bytes); bytes = nullptr; len = 0; }
inline int cmp (const hb_bytes_t &a) const
{