src/hb-vector.hh

Branch


Log

Author Commit Date CI Message
Behdad Esfahbod e1fd2bee 2025-09-18T11:18:09 [alloc-pool] Reduce memory usage by reclaiming some discards
Behdad Esfahbod a22add25 2025-09-18T11:04:06 [alloc-pool] Implement alignment
Behdad Esfahbod 5b04b40d 2025-09-16T16:52:53 [instancer/tuplevars] Allocate compiled_deltas from alloc pool
Behdad Esfahbod bdac0aec 2025-09-16T16:42:32 [vector] Make shrink() useful in un-owned vectors
Behdad Esfahbod c2f21215 2025-09-16T16:29:23 [vector] Simplify allocate_from_pool / set_storage
Behdad Esfahbod fb0ef230 2025-09-16T11:16:30 Revert "[tuplevars] Allocate from pool" This reverts commit 94d78de954ab22f3717cc399920670f877616567. Slowed things down.
Behdad Esfahbod 94d78de9 2025-09-16T11:13:19 [tuplevars] Allocate from pool
Behdad Esfahbod f5fdf426 2025-09-16T02:28:29 [tuplevar] Use pool for duplicating
Behdad Esfahbod 755ed109 2025-09-16T00:40:28 Add hb-alloc-pool and use in gvar instancer
Behdad Esfahbod 82370913 2025-09-15T20:16:52 [vector] Simplify resize()
Behdad Esfahbod 5e816ef7 2025-09-15T18:43:22 [iup] Reuse vectors
Behdad Esfahbod db86e546 2025-09-15T16:41:31 [instancer/gvar] Combine peak_coords mallocs into one chunk
Behdad Esfahbod 26cc7355 2025-09-15T15:49:36 [vector] Remove a comment
Behdad Esfahbod 740cbf1c 2025-09-11T15:30:30 [vector] Add malloc debug facility
Behdad Esfahbod 04953dca 2025-08-21T23:00:37 [vector] Enable set_storage only on trivial types (#5493)
jfkthame c1a75d36 2025-08-21T17:38:04 Avoid UB if shrink_vector(0) is called on an already-empty vector (#5491) Fixes #5489
Behdad Esfahbod 22545743 2025-08-20T00:06:00 Match positions no malloc (#5481) * Reduce allocation of match_positions by caching one in ctx * Use a stack-array for small match-positions This surgically enables stack-backed storage in vector. * Handle match-positions alloc failure And make allocations unchecked. * Clean up CFF hack to use static storage in vector * Fixup for match_positions allocations * Fix vector handling of foreign arrays memory management
Behdad Esfahbod 5f61ccf0 2025-03-13T13:22:28 [set] Fix reallocation Was shrinking malloced vectors inadverently.
Behdad Esfahbod ad0a5c93 2025-03-01T16:02:10 [vector] Add fast path in extend() for length-known iterators
Behdad Esfahbod a037d381 2025-02-26T12:05:12 [vector] Fix operator =
Behdad Esfahbod 0cd98ebb 2025-02-25T18:53:04 [vector] Add a missing fast-path
Behdad Esfahbod 41626401 2025-02-25T18:48:34 [vector] Add faster extend() for array types
Behdad Esfahbod aaf5c06d 2025-02-25T18:45:38 [vector] Rewrite copy_array() to extend vector
Behdad Esfahbod e450552d 2025-02-25T14:54:37 [coord-setter] Fix memory access in case of malloc failure Fixes https://oss-fuzz.com/testcase-detail/5383702943432704
Behdad Esfahbod aaecaa4c 2025-02-24T22:03:00 [vector] Disallow accidental creation of transient vectors Fix sites that were doing this under our feet. This lowers precision of some instancing operations from double to float, which modifies a few results by rounding error. TODO: Update tests.
Behdad Esfahbod 13ee8edf 2025-02-24T21:17:58 [vector] Speed up extend()
Behdad Esfahbod 46485124 2025-02-24T21:04:34 [vector] Simplify a method
Behdad Esfahbod 76c3beaf 2025-02-24T19:50:51 [VARC] Reduce malloc overhead
Behdad Esfahbod d2a88fbd 2025-02-12T21:48:22 [vector] Add alloc_exact()
Bruce Mitchener 3cfdbd67 2024-02-16T23:41:55 Use `noexcept` on swap, move constructors, etc.
Behdad Esfahbod 29d49ece 2023-11-01T15:55:47 [vector] Introduce realloc_moves tag Some types (even aggregate) can be moved using realloc(). Extend the fast path to hb_hashmap and tuple_delta_t.
inobelar 69da5aae 2023-09-22T21:27:12 Added minor fixes to build without errors with gcc 4.9.2
Ben Wagner 4cfc6d8e 2023-08-31T13:54:34 Specify tuple_variations_t special member functions Building with clang complains about the use of `tuple_variations_t`'s implicit copy constructor and copy assignment operator, since automatic generation of these is deprecated when declaring a non-default destructor. This is a good warning because it isn't obvious that copies were being made instead of the object being moved and this struct should be moved and not copied. Declare all the special member functions, defaulting the moves and deleting the copies. After making `tuple_variations_t` move only, an issue is revealed in `hb_vector_t::push` which has been requiring that objects be copyable. Remove the old non-emplacing `push` now that this works with all existing objects and make a single `push` which is more like `std::vector::emplace_back` since that is somewhat what the newer `push` is attempting to do.
Bruce Mitchener f380a328 2023-08-25T14:01:01 Fix some typos.
Behdad Esfahbod 3edd6cdc 2023-06-27T06:56:00 [vector] Minor micro-optimize shrink_vector The compiler seems to understand this pattern better.
Behdad Esfahbod 1fc128f6 2023-06-26T18:34:27 Replace a few memset/memcpy's with hb_ equivalents
Behdad Esfahbod f79d961a 2023-06-26T11:32:37 [vector] Speedup push()
Behdad Esfahbod 793f663b 2023-06-25T17:33:57 [vector] Speed up hb_vector_t<hb_array_t<U>>
Behdad Esfahbod 31d971d1 2023-06-25T17:23:52 [vector] Sprinkle std::addressof
Behdad Esfahbod d36b87bd 2023-06-23T14:42:21 [vector] Speed up hb_vector_t<hb_vector_t<U>>::realloc_vector Use in CFF subsetting.
Behdad Esfahbod b96eed02 2023-06-23T14:30:21 [vector] Speed up vector_t<vector_t<U>>::resize() Used in CFF subsetting...
Behdad Esfahbod 0935b327 2023-06-08T18:47:33 [vector] Speed up shrink_vector for trivial destructors
Behdad Esfahbod fea47dd3 2023-06-08T15:03:27 [vector] Fix vector error handling when allocation used to be 0
Behdad Esfahbod dbdeb264 2023-06-08T12:08:29 [vector] Keep allocated size when in error
Behdad Esfahbod 0364c69e 2023-06-07T15:52:18 [iter] Add has_fast_len Set iterators are not random_access, but have fast len().
Behdad Esfahbod f01ebe97 2023-06-05T21:38:37 [vector] Minor write more idiomatic
Behdad Esfahbod 2b8c4313 2023-06-03T23:01:27 [vector] Oops!
Behdad Esfahbod 054f966a 2023-06-03T22:52:16 [subset/cff1] Don't allocate memory for retaingid holes 40% speedup in BM_subset/subset_glyphs/SourceHanSans-Regular_subset.otf/retaingids/10 benchmark.
Behdad Esfahbod 5872bdf6 2023-05-26T11:41:54 [vector] Add copy-constructor for array_t's
Behdad Esfahbod 1056590f 2023-04-27T10:41:36 [config] Add HB_OPTIMIZE_SIZE_VAL
Behdad Esfahbod 70149885 2023-02-01T14:27:45 [font] Towards implementing emboldening
Behdad Esfahbod 3e471bbc 2023-01-04T11:53:49 [vector] Better test
Behdad Esfahbod d8509061 2023-01-04T11:33:54 [vector] It's okay if shrinking fails
Behdad Esfahbod b6be4550 2023-01-02T18:05:43 [vector] Add resize_exact()
Behdad Esfahbod 9afe5f97 2023-01-02T11:44:29 [vector] Fix leak Discovered by https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=54767
Behdad Esfahbod 55a7d817 2023-01-01T23:07:42 [vector] Allocate exact size in operator=
Behdad Esfahbod 449910d4 2023-01-01T19:27:10 [vector] Allocate exact size in constructor
Behdad Esfahbod b8736076 2023-01-01T18:38:28 [vector] Support shrinking storage if exact size provided Only do it if requested size is less than quarter of allocated size. This has massive benefit during CFF subset preprocessing.
Behdad Esfahbod 2eacc37e 2022-12-31T12:27:13 [vector] Add internal API for exact-size allocation Use it from a couple of places.
Behdad Esfahbod 8e9e94db 2022-12-01T19:40:21 Revert "[vector] Optimize grow_vector() for size" This reverts commit 1dd9396c7a4c24fe9d578551fab735bdd699e52a. Is faster indeed. 15% on SourceHanSans/10000 benchmark.
Behdad Esfahbod a66de336 2022-12-01T14:32:13 [vector] Minor use get_size() in as_bytes()
Behdad Esfahbod 7129b794 2022-11-29T15:33:07 [open-type] Add faster range-based loop to array types
Behdad Esfahbod 915c1a00 2022-11-26T14:48:57 [vector] Add remove_unordered Saves 5% in NotoNastaliq/1000 subset benchmark.
Behdad Esfahbod 4b8d8fbe 2022-11-26T14:31:15 [ot-map] Micro-optimize for size
Behdad Esfahbod e333223f 2022-11-25T14:23:57 [array] Optimize serializing copy()
Behdad Esfahbod 7b197446 2022-11-25T13:28:53 [vector] Adjust for HB_OPTIMIZE_SIZE
Behdad Esfahbod d2a2f5bf 2022-11-25T12:44:02 [vector] Handroll copy
Behdad Esfahbod b0d26411 2022-11-22T10:20:11 [vector] Add "initialize" argument to resize()
Behdad Esfahbod 7cc79a8a 2022-11-21T12:09:24 [vector] Adjust comment
Behdad Esfahbod e82a3c69 2022-11-21T12:00:10 [array/vector] Optimize range-based for-loop Avoid bounds-checking.
Behdad Esfahbod 2892fc71 2022-11-18T18:03:59 [vector] Add std::move to pop() This was removed in 76fc27713f52cc338f0325650c2c7798f5cfa2ce, but I believe that was faultly. It was because of a bad move implementation in the set.
Behdad Esfahbod bef5a1c8 2022-11-18T17:22:17 [vector] Comment
Behdad Esfahbod 69b41f92 2022-11-18T17:04:34 [vector] Simplify shift_down_vector() Compiler is smarter than I am.
Behdad Esfahbod 1dd9396c 2022-11-18T17:01:14 [vector] Optimize grow_vector() for size Again, compiler is smarter than I am.
Behdad Esfahbod d36f6881 2022-11-18T17:00:07 [vector] Optimize shrink_vector for size Compiler is smarter than I am.
Behdad Esfahbod bc8eded2 2022-11-18T16:51:24 [vector] Remove a for loop
Behdad Esfahbod afd9a58b 2022-11-18T16:46:01 [vector] Save a couple hb_iter() invocations
Behdad Esfahbod f2b5db70 2022-11-16T21:22:43 [vector] Remove .sub_array ()
Behdad Esfahbod c7d57dcf 2022-11-16T21:21:31 [vector/array] Simplify qsort()
Behdad Esfahbod 4e618557 2022-11-13T17:23:25 [vector] Don't subclass sorted vector from unsorted Was doubling the size unnecessarily.
Behdad Esfahbod cddcb310 2022-07-12T13:15:38 [vector] Remove residual nullptr_t from when hashmap needed it
Behdad Esfahbod 30ba9a39 2022-05-19T17:34:58 [vector] Add emplacing push implementation
Behdad Esfahbod a47b0aeb 2022-05-19T15:52:00 [vector] Fix remove() implementation test-vector under valgrind happy now.
Behdad Esfahbod 6544fc28 2022-05-19T15:28:09 [vector] Add further copy implementation
Behdad Esfahbod c19f1169 2022-05-19T15:27:52 [meta] Remove non-existing gcc4 trait implementation
Behdad Esfahbod fb77f48f 2022-05-19T15:02:10 [vector] Optimize vector copy
Behdad Esfahbod 544ffb91 2022-05-19T14:50:12 [set] Adjust grow_vector condition
Behdad Esfahbod 14a24d8e 2022-05-19T13:03:50 [vector] Make hb_vector_t hashable
Thomas Devoogdt c657c4e1 2022-05-10T10:00:06 [meta] fix type traits on gcc 4.9 #3526 Signed-off-by: Thomas Devoogdt <thomas.devoogdt@barco.com>
Behdad Esfahbod 76fc2771 2022-05-12T12:14:07 [vector] Remove explicit std::move Was confusing compilers. Let them figure it out themselves. Makes NotoNastaliqu subsetting/1000 benchmark more than twice faster: Benchmark Time CPU Time Old Time New CPU Old CPU New ------------------------------------------------------------------------------------------------------------------------------------------------------------ BM_subset/subset_glyphs/NotoNastaliqUrdu-Regular.ttf/1000 -0.5064 -0.5065 111 55 110 55 BM_subset/subset_codepoints/NotoNastaliqUrdu-Regular.ttf/1000 -0.5494 -0.5493 132 59 131 59
Behdad Esfahbod 2e7f1ae4 2022-05-11T12:49:16 [subset] Use vector.allocated size instead of tracking buf_size
Behdad Esfahbod 106388e7 2022-01-19T11:38:37 [vector] Merge sorted-vector into vector Was easier than I thought! Let's see what the bot gods think...
Behdad Esfahbod 294d50ff 2022-01-19T11:32:14 [vector] Add sorted template argument
Behdad Esfahbod cd979978 2022-01-19T11:14:25 [vector] Remove old find() method
Behdad Esfahbod 6ef83c2c 2022-01-18T13:08:34 [vector] Remove .fini_deep()
Behdad Esfahbod 213e3f09 2022-01-18T09:39:46 [vector] Add TODO Emplace?
Behdad Esfahbod 1198fb24 2022-01-16T06:29:35 [vector] Adjust construction criteria
Behdad Esfahbod c58bfa35 2022-01-15T18:06:03 [vector] Move semantics in vector remove()
Behdad Esfahbod 5946e945 2022-01-15T18:00:18 [vector] Destruct in pop()
Behdad Esfahbod 7171917b 2022-01-15T17:16:40 [vector] Construct items when enlarging