diff options
author | Akira Kakuto <kakuto@fuk.kindai.ac.jp> | 2018-03-07 22:32:14 +0000 |
---|---|---|
committer | Akira Kakuto <kakuto@fuk.kindai.ac.jp> | 2018-03-07 22:32:14 +0000 |
commit | ef9282421b00185a4962b7d22b96e979687258e2 (patch) | |
tree | b6d0d8c700086d3141e228187693a26b102c971f /Build/source/libs/harfbuzz/harfbuzz-src/src/hb-blob.cc | |
parent | 55fbdeae2498166ec7c7301fd48d990fc9010058 (diff) |
harfbuzz-1.7.6
git-svn-id: svn://tug.org/texlive/trunk@46877 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build/source/libs/harfbuzz/harfbuzz-src/src/hb-blob.cc')
-rw-r--r-- | Build/source/libs/harfbuzz/harfbuzz-src/src/hb-blob.cc | 27 |
1 files changed, 26 insertions, 1 deletions
diff --git a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-blob.cc b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-blob.cc index 4cf6d1e5451..b5291f650cc 100644 --- a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-blob.cc +++ b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-blob.cc @@ -171,6 +171,31 @@ hb_blob_create_sub_blob (hb_blob_t *parent, } /** + * hb_blob_copy_writable_or_fail: + * @blob: A blob. + * + * Makes a writable copy of @blob. + * + * Return value: New blob, or nullptr if allocation failed. + * + * Since: 1.8.0 + **/ +hb_blob_t * +hb_blob_copy_writable_or_fail (hb_blob_t *blob) +{ + blob = hb_blob_create (blob->data, + blob->length, + HB_MEMORY_MODE_DUPLICATE, + nullptr, + nullptr); + + if (unlikely (blob == hb_blob_get_empty ())) + blob = nullptr; + + return blob; +} + +/** * hb_blob_get_empty: * * Returns the singleton empty blob. @@ -222,7 +247,7 @@ hb_blob_reference (hb_blob_t *blob) * hb_blob_destroy: (skip) * @blob: a blob. * - * Descreases the reference count on @blob, and if it reaches zero, destroys + * Decreases the reference count on @blob, and if it reaches zero, destroys * @blob, freeing all memory, possibly calling the destroy-callback the blob * was created for if it has not been called already. * |