src/hb-blob.cc


Log

Author Commit Date CI Message
Behdad Esfahbod cf5fa57f 2018-10-27T04:50:38 [docs] Change section titles again I think I like the uniform "hb-*" more.
Behdad Esfahbod 5dd86aa3 2018-10-27T04:28:40 [docs] Rename section titles to object names More useful.
Behdad Esfahbod 00cf4e5e 2018-10-27T04:07:33 [docs] Fill in some sections
Khaled Hosny 30cbe615 2018-10-19T22:04:56 Use O_BINARY instead of _O_BINARY Cygwin does not seem to have the later
Behdad Esfahbod 6e07076f 2018-10-14T22:22:45 [blob] Fix UBSan error
Behdad Esfahbod 3f08750f 2018-09-30T18:23:34 Move _POSIX_SOURCE to hb.hh
Behdad Esfahbod 90a0f9fa 2018-09-26T15:03:07 Make TSan happy with make_immutable()
Matt Oliver 24dd6c1a 2018-09-23T18:08:30 src/hb-blob.cc: Fix mmap functionality with UWP.
Behdad Esfahbod c77ae408 2018-08-25T22:36:36 Rename hb-*private.hh to hb-*.hh Sorry for the noise, downstream custom builders. Please adjust.
Behdad Esfahbod 3506672c 2018-08-06T06:17:48 Port _nil objects to Null() machinery Finally, unified!
Behdad Esfahbod be458eb0 2018-07-10T14:41:04 Include more basic internal headers from hb-private.hh
Ebrahim Byagowi d8a7dedc 2018-07-04T15:33:39 Use CreateFileW explicitly and pass wchar_t to it (#1087)
Behdad Esfahbod 2cb075fe 2018-07-03T13:04:05 Fix unused function '_hb_mapped_file_destroy' if no mmap
Ebrahim Byagowi 5d8cafcf 2018-07-01T01:54:14 Improve nommap naming and use C style comments on create_from_file (#1084)
Ebrahim Byagowi 25970a93 2018-06-28T14:32:36 armcc compatibility, don't use EINTR if doesn't exist Fixes #1081
Ebrahim Byagowi 8a51f91b 2018-06-28T13:22:21 Minor on hb_blob_create_from_file, reuse ferror result Oops
Ebrahim Byagowi 7b4099f3 2018-06-27T16:54:44 Minor, rename blob to data on blob_from_file
Ebrahim Byagowi fa090ed4 2018-06-27T14:13:26 Minor touches on hb_blob_create_from_file (#1079) * Handle EINTR on fallback reader * Increase fallback reader limitation size limitation to 2 << 28 * Ensure _O_BINARY does exist if MMAP is used on Windows (maybe superfluous but makes me more confident)
Ebrahim Byagowi 7db2e9ea 2018-06-26T10:46:10 Minor on hb_blob_create_from_file Add one more "unlikely" annotation and use explicit nullptr check for more consistency.
Ebrahim Byagowi 35ce8f31 2018-06-25T22:23:43 Unify our pipe reader with the fallback reader (#1068) And assign one bot to use the path always using NOMMAPFILEREADER token. It's limited to 200mb so no more fun with using /dev/zero on hb-view!
Ebrahim Byagowi 941f2b85 2018-06-18T20:35:40 Support pipe and friends on hb_blob_create_from_file (#1061) With this hb-view/hb-shape support pipes and possibly socket and named pipe also, anything fails just on mmap. We can later do the same for Windows also. This however reveals two issues, the fact most of our bots don't have HAVE_MMAP and using this instead the other fread/fopen reader can make failure on CI. I should look at them separately this change however is very low risk I believe.
Behdad Esfahbod df01f3e5 2018-06-05T15:17:39 1.7.7
Ebrahim Byagowi 65c82179 2018-05-26T23:50:10 [blob] Use MAP_NORESERVE if available (#1039) MAP_NORESERVE is not available on macOS for example so set the flag to zero if not defined on the headers.
Ebrahim Byagowi 8eb53b85 2018-05-11T22:44:44 Minor, make CreateFile compatible with the disabled writable flag "writable" is not in use and probably we can go in the reverse direction and remove the flags that are useful for enabled writable, this is just for the sake of completeness however.
Ebrahim Byagowi 33eb1bd2 2018-05-11T14:36:41 Remove unnecessary headers and definitions of hb-blob (#1028) It removes io.h and other polyfills which we no longer need as 7e76d74
Ebrahim Byagowi 7e76d746 2018-05-11T13:40:33 Make hb_blob_create_from_file more portable (#1027) This makes it compatible with ARMCC which I had access in a collaboration with @imgtec, thanks! Basically hb_blob_create_from_file features three code paths, mmap, Win32 and fallback. We had fallback implementation even before this but it was relied to "open" which is not available on some environments. This change improved the situtation by using only fopen and friends for fallback path. Interestingly we could use "open" on Windows but in fact it was emulated by MSVCRT so I've completely split that from Unix path now that we have a distinct path for fallback path also.
Behdad Esfahbod 90baf721 2018-05-03T22:14:54 Move some blob functions to methods
Behdad Esfahbod 5c64d614 2018-05-03T21:10:57 Add hb-blob-private.hh Towards making blob more memory-allocation-friendly
Ebrahim Byagowi 5ad87a93 2018-04-25T16:44:04 Minor, improve file reading failing condition comment https://bugzilla.gnome.org/show_bug.cgi?id=659212 for more context
Ebrahim Byagowi 8100380d 2018-04-22T10:58:37 Minor, fix calloc call order
Ebrahim Byagowi ce17340b 2018-04-20T10:29:06 Add hb_blob_create_from_file, a new API (#926)
Behdad Esfahbod a989f3ed 2018-02-13T22:12:36 Add hb_blob_copy_writable_or_fail() New API: - hb_blob_copy_writable_or_fail()
Bruce Mitchener 90218fa9 2018-01-31T20:44:45 Fix typos.
Ting-Wei Lan e3a15d0c 2018-01-12T15:33:16 Update _POSIX_C_SOURCE to the latest version Defining _POSIX_C_SOURCE to an old version on FreeBSD can cause C99 to be disabled in libc.
Behdad Esfahbod 40ec3bbb 2017-11-03T16:57:30 Consolidate debug stuff into hb-debug.hh Part of fixing https://github.com/behdad/harfbuzz/pull/605
Behdad Esfahbod dbdbfe3d 2017-10-15T12:11:08 Use nullptr instead of NULL
Behdad Esfahbod e1b6d923 2017-10-11T15:51:31 Remove cast of functions to (hb_destroy_func_t) Fixes https://github.com/behdad/harfbuzz/issues/474
Behdad Esfahbod 568a0c60 2016-02-18T19:31:51 Remove pointless overflow check in pointer math Fixes https://github.com/behdad/harfbuzz/issues/227
Behdad Esfahbod b8811429 2015-09-03T15:53:22 Fix Since tags Fixes https://github.com/behdad/harfbuzz/issues/103
Behdad Esfahbod 2cd53235 2015-01-06T19:16:38 [bindings] Use hb_glib_blob_create() in sample hb_blob_create() is considered C-only API.
Behdad Esfahbod b91904a4 2015-01-06T15:43:14 [bindings] Replace deprecated allow-none with optional and nullable
Behdad Esfahbod b632e799 2015-01-06T14:05:26 Fix up gobject-introspection a bit Minimal shaping works now!
Behdad Esfahbod 7d5e7613 2014-12-18T18:22:21 Fail blob creation if length overflows or is too large Fail if blob start plus length overflows; or if blob length is greater than 2GB. It takes a while for fonts to get to that size. In the mean time, it protects against bugs like this: http://www.icu-project.org/trac/ticket/11450 Also avoids some weird issues with 32bit vs 64bit systems as we accept length as unsigned int. As such, a length of -1 will cause overflow on 32bit machines, but happily accepted on a 64bit machine. Avoid that.
Behdad Esfahbod 73f7f891 2014-07-09T17:17:18 Define _POSIX_C_SOURCE only if it is not defined Fixes https://github.com/behdad/harfbuzz/pull/45
Behdad Esfahbod 2a8c49ad 2013-12-11T20:22:28 Remove unnecessary includes
Behdad Esfahbod a8949df4 2013-09-13T20:23:51 [introspection] Annotate Unicode / font callbacks Should move these out of the public header... We're "clean" of introspection warnings now. Remaining ones are about graphite2 / freetype types not being introspectable.
Behdad Esfahbod dfdbe7f9 2013-09-12T20:52:20 [introspection] Make hb_blob_create() introspectable
Behdad Esfahbod 085d4291 2013-09-12T17:14:33 [introspection] Disable constructors for now Since our types are not associated with their methods, marking constructors makes them inaccessible from bindings. Undo for now.
Behdad Esfahbod 288f2899 2013-09-06T15:40:22 [docs/introspection] More annotations
Behdad Esfahbod 5f512017 2013-09-04T18:28:39 [docs] Document a few symbols
Behdad Esfahbod c3ba49b6 2013-02-25T17:06:35 Always create sub-blobs in MEMORY_MODE_READONLY This fixes a design bug with sanitize and sub-blobs that can cause crashes. Jonathan and I found and debugged this issue when we tested a corrupt font with the md5sum / filename: ea395483d37af0cb933f40689ff7b60a. Two hours of intense debugging we found out that the font has overlapping GSUB/GPOS tables, and as such, sanitizing the second table can modify the first one, which can cause all kinds of undefined behavior. The correct way to fix this is to make sure sub-blobs are always created readonly, since we consider the parent blob to be a shared resource and can't modify it, even if it *is* writable. This essentially makes the READONLY_MAY_MAKE_WRITABLE mode unused... Maybe we should simply remove / deprecate it.
Behdad Esfahbod 52c8d122 2013-01-14T13:51:46 Minor
Behdad Esfahbod f88d3bd7 2013-01-14T00:33:58 Fix build with Sun compiler
Behdad Esfahbod 1bc1cb36 2012-06-16T15:21:55 Make source more digestable for gobject-introspection
Behdad Esfahbod 6220e5fc 2012-06-06T03:30:09 Add ASSERT_POD for most objects
Behdad Esfahbod 0594a244 2012-06-05T20:35:40 Cleanup TRUE/FALSE vs true/false
Behdad Esfahbod f06ab8a4 2012-06-05T12:31:51 Better hide nil objects and make them const
Behdad Esfahbod bc71ad49 2012-03-01T17:30:29 Fix atomic-int op on Apple The OSAtomicAdd32Barrier operator returns the new value, we want the old value.
Behdad Esfahbod b95324cd 2011-09-21T16:50:39 Minor
Behdad Esfahbod 33ccc779 2011-08-09T00:43:24 [API] Make set_user_data() functions take a replace parameter We need this to set data on objects safely without worrying that some other thread unsets it by setting it at the same time.
Behdad Esfahbod c605bbbb 2011-08-04T20:00:53 Remove C++ guards from source files Where causing issues for people with MSVC.
Behdad Esfahbod cc06c243 2011-07-25T20:25:44 Streamline debugging infrastructure even more
Behdad Esfahbod 43ff203d 2011-07-25T17:35:24 Use variadic macros for debugging Looks *so* much nicer!
Behdad Esfahbod decd4e3e 2011-07-25T16:47:02 Add sugar syntax for debug messages Buffer debugging coming soon.
Behdad Esfahbod b9452bfc 2011-06-14T14:47:07 Fix compiler warnings with -pedantic
Behdad Esfahbod 4101ca7d 2011-05-11T14:30:56 Plug more leaks All good now.
Behdad Esfahbod 1c9f8717 2011-05-06T22:28:26 [API] Simplify blob API, remove lock
Behdad Esfahbod a0f337a1 2011-05-06T19:20:52 Remove unused hb_blob_try_writable_inplace()
Behdad Esfahbod b81bd429 2011-05-05T00:21:16 Make hb_mutex_*() macros take a pointer More intuitive.
Behdad Esfahbod 56eb5ad6 2011-05-04T19:27:37 Move code around Mutex (and Windows.h by extension) are fairly isolated now.
Behdad Esfahbod d4141a44 2011-05-03T00:19:18 [blob] Implement sub_blob() in terms of create() Fixes problem with uninitialized sub_blob->mutex among other things. Reported by Bradley Grainger.
Behdad Esfahbod f55272ec 2011-05-02T20:57:28 Add hb_mutex_free() and use it Based on patch by Bradley Grainger.
Behdad Esfahbod 4911062d 2011-05-02T19:36:39 [API] Rename hb_blob_create_empty() to hb_blob_get_empty()
Behdad Esfahbod 5fa849b7 2011-04-27T21:46:01 [API] Add _set/get_user_data() for all objects
Behdad Esfahbod 47e71d96 2011-04-27T16:38:03 [object] Remove unnecessary use of macros
Behdad Esfahbod 8be1420f 2011-04-27T16:14:04 [blob] Use HB_FUNC instead of __FUNCTION__
Behdad Esfahbod fca368c4 2011-04-21T18:24:02 Add hb_object_header_t which is the common part of all objects Makes way for adding arbitrary user_data support.
Behdad Esfahbod 2409d5f8 2011-04-21T17:14:28 Update Copyright headers
Behdad Esfahbod c57d454a 2011-04-20T18:50:27 Rename all private sources and headers to C++ files So we can liberally use the simple features of C++ that parts of the codebase is already using.
Behdad Esfahbod f19f4f9b 2011-04-20T18:25:56 Rename hb-blob.c to hb-blob.cc in preparation of more changes