Behdad Esfahbod
5570c87f21
Port objects to use header.writable instead of immutable
...
Saves 4 or 8 bytes per object on 64bit archs.
2018-11-03 14:59:40 -04:00
Behdad Esfahbod
cf5fa57f00
[docs] Change section titles again
...
I think I like the uniform "hb-*" more.
2018-10-27 04:51:42 -07:00
Behdad Esfahbod
5dd86aa33b
[docs] Rename section titles to object names
...
More useful.
2018-10-27 04:47:41 -07:00
Behdad Esfahbod
00cf4e5eb6
[docs] Fill in some sections
2018-10-27 04:47:41 -07:00
Khaled Hosny
30cbe6158d
Use O_BINARY instead of _O_BINARY
...
Cygwin does not seem to have the later
2018-10-19 22:46:40 +02:00
Behdad Esfahbod
6e07076fd0
[blob] Fix UBSan error
2018-10-14 22:22:45 -07:00
Behdad Esfahbod
3f08750fa6
Move _POSIX_SOURCE to hb.hh
2018-09-30 18:23:34 +02:00
Behdad Esfahbod
90a0f9fa0c
Make TSan happy with make_immutable()
2018-09-26 15:03:07 -04:00
Matt Oliver
24dd6c1a9d
src/hb-blob.cc: Fix mmap functionality with UWP.
2018-09-23 07:23:58 -07:00
Behdad Esfahbod
c77ae40852
Rename hb-*private.hh to hb-*.hh
...
Sorry for the noise, downstream custom builders. Please adjust.
2018-08-25 22:36:36 -07:00
Behdad Esfahbod
3506672ce9
Port _nil objects to Null() machinery
...
Finally, unified!
2018-08-06 06:17:48 -07:00
Behdad Esfahbod
be458eb059
Include more basic internal headers from hb-private.hh
2018-07-10 14:41:04 +02:00
Ebrahim Byagowi
d8a7dedc83
Use CreateFileW explicitly and pass wchar_t to it ( #1087 )
2018-07-04 15:33:39 +04:30
Behdad Esfahbod
2cb075fe26
Fix unused function '_hb_mapped_file_destroy' if no mmap
2018-07-03 13:04:05 +04:30
Ebrahim Byagowi
5d8cafcf6a
Improve nommap naming and use C style comments on create_from_file ( #1084 )
2018-07-01 01:54:14 +04:30
Ebrahim Byagowi
25970a93aa
armcc compatibility, don't use EINTR if doesn't exist
...
Fixes #1081
2018-06-28 14:32:36 +04:30
Ebrahim Byagowi
8a51f91b70
Minor on hb_blob_create_from_file, reuse ferror result
...
Oops
2018-06-28 13:22:21 +04:30
Ebrahim Byagowi
7b4099f35f
Minor, rename blob to data on blob_from_file
2018-06-27 16:54:44 +04:30
Ebrahim Byagowi
fa090ed4d4
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)
2018-06-27 14:13:26 +04:30
Ebrahim Byagowi
7db2e9ea38
Minor on hb_blob_create_from_file
...
Add one more "unlikely" annotation and use explicit nullptr check for more consistency.
2018-06-26 10:46:10 +04:30
Ebrahim Byagowi
35ce8f31d3
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!
2018-06-25 22:23:43 +04:30
Ebrahim Byagowi
941f2b8548
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.
2018-06-18 20:35:40 +04:30
Behdad Esfahbod
df01f3e560
1.7.7
2018-06-05 15:18:16 -07:00
Ebrahim Byagowi
65c82179c9
[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.
2018-05-26 23:50:10 +04:30
Ebrahim Byagowi
8eb53b853d
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.
2018-05-11 22:44:44 +04:30
Ebrahim Byagowi
33eb1bd23b
Remove unnecessary headers and definitions of hb-blob ( #1028 )
...
It removes io.h and other polyfills which we no longer need as 7e76d74
2018-05-11 14:36:41 +04:30
Ebrahim Byagowi
7e76d746e2
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.
2018-05-11 13:40:33 +04:30
Behdad Esfahbod
90baf72197
Move some blob functions to methods
2018-05-07 13:38:19 -07:00
Behdad Esfahbod
5c64d61475
Add hb-blob-private.hh
...
Towards making blob more memory-allocation-friendly
2018-05-07 13:38:19 -07:00
Ebrahim Byagowi
5ad87a93fe
Minor, improve file reading failing condition comment
...
https://bugzilla.gnome.org/show_bug.cgi?id=659212 for more context
2018-04-25 16:44:04 +04:30
Ebrahim Byagowi
8100380d9e
Minor, fix calloc call order
2018-04-22 10:58:37 +04:30
Ebrahim Byagowi
ce17340b23
Add hb_blob_create_from_file, a new API ( #926 )
2018-04-20 07:59:06 +02:00
Behdad Esfahbod
a989f3edec
Add hb_blob_copy_writable_or_fail()
...
New API:
- hb_blob_copy_writable_or_fail()
2018-02-13 22:12:36 -08:00
Bruce Mitchener
90218fa93c
Fix typos.
2018-01-31 08:18:15 -08:00
Ting-Wei Lan
e3a15d0c6d
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.
2018-01-12 09:19:41 +01:00
Behdad Esfahbod
40ec3bbb55
Consolidate debug stuff into hb-debug.hh
...
Part of fixing https://github.com/behdad/harfbuzz/pull/605
2017-11-03 17:18:17 -04:00
Behdad Esfahbod
dbdbfe3d7b
Use nullptr instead of NULL
2017-10-15 12:11:08 +02:00
Behdad Esfahbod
e1b6d92302
Remove cast of functions to (hb_destroy_func_t)
...
Fixes https://github.com/behdad/harfbuzz/issues/474
2017-10-11 15:51:31 +02:00
Behdad Esfahbod
568a0c60e8
Remove pointless overflow check in pointer math
...
Fixes https://github.com/behdad/harfbuzz/issues/227
2016-02-18 19:31:51 +07:00
Behdad Esfahbod
b8811429b6
Fix Since tags
...
Fixes https://github.com/behdad/harfbuzz/issues/103
2015-09-03 15:53:22 +04:30
Behdad Esfahbod
2cd5323531
[bindings] Use hb_glib_blob_create() in sample
...
hb_blob_create() is considered C-only API.
2015-01-06 19:16:38 -08:00
Behdad Esfahbod
b91904a40d
[bindings] Replace deprecated allow-none with optional and nullable
2015-01-06 15:43:14 -08:00
Behdad Esfahbod
b632e7997d
Fix up gobject-introspection a bit
...
Minimal shaping works now!
2015-01-06 14:05:26 -08:00
Behdad Esfahbod
7d5e7613ce
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.
2014-12-18 18:22:21 -08:00
Behdad Esfahbod
73f7f8919e
Define _POSIX_C_SOURCE only if it is not defined
...
Fixes https://github.com/behdad/harfbuzz/pull/45
2014-07-09 17:17:18 -04:00
Behdad Esfahbod
2a8c49ade0
Remove unnecessary includes
2013-12-11 20:24:20 -05:00
Behdad Esfahbod
a8949df487
[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.
2013-09-13 20:31:07 -04:00
Behdad Esfahbod
dfdbe7f932
[introspection] Make hb_blob_create() introspectable
2013-09-12 20:52:20 -04:00
Behdad Esfahbod
085d4291a9
[introspection] Disable constructors for now
...
Since our types are not associated with their methods, marking
constructors makes them inaccessible from bindings. Undo for now.
2013-09-12 17:14:33 -04:00
Behdad Esfahbod
288f289997
[docs/introspection] More annotations
2013-09-06 17:30:54 -04:00