Commit Graph

183 Commits

Author SHA1 Message Date
Behdad Esfahbod fe94c760e1 [algs] Build fix for clang and __builtin_mul_overflow
Fixes https://github.com/harfbuzz/harfbuzz/issues/4066
2023-01-23 14:05:28 -07:00
Behdad Esfahbod ff419789ef [subset-plan] Sort unicode_to_new_gid_list when needed 2022-12-02 16:43:33 -07:00
Behdad Esfahbod 35878df215 [algs] Implement swap() for pair_t
Helps priority_queue::pop_minimum and friends, which help subsetter
repacker. Shows a few percentage improvement on NotoNastaliq benchmark.
2022-11-21 19:14:03 -07:00
Behdad Esfahbod 3ff75411bd [algs] Fix bot fail 2022-11-21 13:08:55 -07:00
Behdad Esfahbod 4c14043b06 [algs] Add output argument to hb_unsigned_mul_overflows() 2022-11-21 12:56:33 -07:00
Behdad Esfahbod 25adbb3825 [algs] Use __builtin_mul_overflow
Compiles to smaller binary.
2022-11-21 12:47:53 -07:00
Behdad Esfahbod a10cfe3f32 [algs] Write hb_in_ranges() recursively 2022-11-21 12:37:59 -07:00
Behdad Esfahbod 70a5cd53f6 [algs] Assert trivial copy assignable in stable_sort 2022-11-21 08:52:33 -07:00
Behdad Esfahbod 9bb39423f5 [algs] Simplify stable_sort signatures 2022-11-20 17:40:54 -07:00
Behdad Esfahbod a9c6a20b19 [map] Support moving value in sink interface 2022-11-18 18:29:12 -07:00
Behdad Esfahbod 43a4028f0e [algs] Move hb_vector_size_t to bit-page as only user 2022-11-18 15:54:34 -07:00
Behdad Esfahbod 3aad7c2ddf [algs] Remove smart-pointers from hb_hash()
hb_deref() handles them. I think this code predated that.
2022-11-17 15:10:47 -07:00
Behdad Esfahbod c9e843942e [min/max] Don't forward argument 2022-07-22 09:01:28 -06:00
Behdad Esfahbod 0cc2f3c218 [algs] Remove hb_pair_t() 2022-07-21 16:46:45 -06:00
Behdad Esfahbod 90e40f24fe [algs] Tweak attribute(packed) usage
Allow disabling it. Also don't cast this pointer.
2022-07-17 15:01:04 -06:00
Behdad Esfahbod 4ee471922d More -Wcomma fixes
Fixes https://github.com/harfbuzz/harfbuzz/issues/3716
2022-07-13 13:59:35 -06:00
David Corbett 04c4767150 [lao] Decompose and reorder U+0EB3 around U+0EBB 2022-06-27 11:31:32 -06:00
Behdad Esfahbod 215a0afad1 [algs] Remove unused hb_coerce() 2022-06-03 01:48:46 -06:00
Behdad Esfahbod d7785a6da0 [cplusplus] Add unique_ptr 2022-06-02 12:43:04 -06:00
Behdad Esfahbod 7ec3aad20f [shared_ptr] Fix hb_hash() crash on nullptr 2022-06-02 18:22:05 +01:00
Behdad Esfahbod a089d91fda [hash] Adjust hash for shared_ptr, implement it for std::hash 2022-06-02 18:22:05 +01:00
Behdad Esfahbod e037325efb [hash] Remove custom hash, rely on std::hash 2022-06-02 18:22:05 +01:00
Behdad Esfahbod 0b35940a72 Make hb::shared_ptr hashable 2022-06-02 18:22:05 +01:00
Behdad Esfahbod 45a2252607 [flags] Fix undefined-behavior
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior ../src/hb-buffer.hh:60:1 in
failure on clusterfuzz-testcase-minimized-hb-subset-get-codepoints-fuzzer-5736539338833920
2022-05-31 06:35:42 -06:00
Behdad Esfahbod b4d1ec310c [algs] Declare coerce() as constexpr 2022-05-19 16:06:21 -06:00
Behdad Esfahbod 15fa8afb21 Add fast-path for big-endian 32-bit byteswap
Speeds up cmap format-12 decoding by some 40% as measured by
the newly added test in perf/benchmark-font!
2022-05-02 16:46:41 -06:00
Behdad Esfahbod 8e900f2cda Revert "hb-algs.hh: Fix build on Visual Studio 2015"
This reverts commit 52c536bb8d.

See https://github.com/harfbuzz/harfbuzz/pull/3448
2022-02-17 13:29:04 -06:00
Behdad Esfahbod 94517850dd [algs] Fix typo in hb_pair_t conversion operator
Fixes https://github.com/harfbuzz/harfbuzz/issues/2083
2022-02-13 13:39:26 -06:00
Chun-wei Fan 52c536bb8d hb-algs.hh: Fix build on Visual Studio 2015
The compiler does not recognize the std::hash call on
hb_decay<decltype (hb_deref (v)>, so give it a shove so that it is recognized
there.
2022-02-10 13:26:56 -06:00
Behdad Esfahbod cd9799784c [vector] Remove old find() method 2022-01-19 11:14:25 -07:00
Behdad Esfahbod 92f179075f Make hb_coerce static inline
That's the pattern we follow.

985b63b3ee (commitcomment-63973544)
2022-01-16 07:51:35 -07:00
Behdad Esfahbod 19793f333b Better try at previous commit
985b63b3ee (commitcomment-63973544)
2022-01-16 07:49:40 -07:00
Behdad Esfahbod 1173ed1f7f Try fix Mac build
985b63b3ee (commitcomment-63973544)
2022-01-16 07:48:02 -07:00
Behdad Esfahbod c0f57ccc88 [algs] Add default-construtor to hb_pair_t 2022-01-16 07:01:05 -07:00
Behdad Esfahbod 8a69e00639 [meta] Use std::addressof() instead of hb_addressof() 2022-01-13 16:17:34 -07:00
Behdad Esfahbod 47afb3ef04 [meta] Replace hb_is_pointer with std::is_pointer 2022-01-13 15:27:41 -07:00
Behdad Esfahbod 985b63b3ee [map] Allow invalid items to be pointer to static object
By derefencing them when necessary.

Also, we do not rely on trivially-copyable, so remove that assertion.
2022-01-13 13:33:07 -07:00
Behdad Esfahbod 1e27f95dc1 [algs] Add hb_coerce() 2022-01-13 13:10:47 -07:00
Behdad Esfahbod cfe2b66114 [algs] Fix hash chaining to std::hash() 2022-01-13 12:18:59 -07:00
Behdad Esfahbod 53847dba92 [algs] Call std::hash from hb_hash() 2022-01-12 10:35:28 -07:00
Behdad Esfahbod 943921cf0c [meta] Use more std type_traits 2021-11-02 00:26:46 -06:00
Behdad Esfahbod 6d555ce82e [meta] Use std::forward instead of hb_forward() 2021-11-02 00:18:22 -06:00
Behdad Esfahbod 30c05e8b55 [algs] include <new> 2021-11-01 23:57:00 -06:00
Behdad Esfahbod 3604f5f248 [algs] Include <initializer_list> 2021-11-01 22:37:42 -06:00
Behdad Esfahbod 8c05569930 [algs] Add hb_swap() ala, and using, std::swap()
Use it in vector.

Use ADL idiom.
2021-11-01 17:59:17 -06:00
Behdad Esfahbod f09d5ed0f5 [algs] Remove hb_bitwise_non() 2021-08-19 13:06:10 -06:00
Behdad Esfahbod b94f24ec79 [bit-set-invertible] Implement set algebra 2021-08-19 00:48:00 -06:00
Behdad Esfahbod 6afefe1dc3 [algs] Remove unnecessary struct tag names 2021-08-19 00:27:03 -06:00
Behdad Esfahbod bf2c87bfe6 Add hb_memcpy() that does len=0 check 2021-07-27 13:26:00 -06:00
Behdad Esfahbod cc16b26ef4 [constexpr] IntType
See https://github.com/harfbuzz/harfbuzz/pull/2875
2021-02-22 21:59:56 -07:00