Commit Graph

30 Commits

Author SHA1 Message Date
Behdad Esfahbod cb47dca74c [object] Handle mallocation error in set_user_data
Should make bots happy.
2023-01-29 10:57:29 -07:00
Behdad Esfahbod 548bad221c [user-data] Move methods to header file
No idea why they were in hb-static.
2023-01-29 10:11:40 -07:00
Behdad Esfahbod 87a88117c8 [object] Use vector tail() 2022-11-20 14:10:39 -07:00
Behdad Esfahbod 1d41b9cb3c [user-data] std::move item 2022-11-17 16:26:48 -07:00
Behdad Esfahbod 2eda2ab3bb [object] Forward hb_object_create() arguments to constructor 2022-08-18 16:15:54 -06:00
Behdad Esfahbod de37b2650d [object] Only destruct object if it's not trivially-destructible
Such that we're legally free to access the object to destruct its
(pointer) fields ourselves afterwards.  For things like hb_font_t,
hb_face_t, etc.
2022-08-18 15:21:48 -06:00
Behdad Esfahbod f73c15ca6c [atomic-int] Add operators for relaxed ops 2022-08-03 13:01:04 -06:00
Behdad Esfahbod 86d1e22d4f [atomic-ptr] Rename get 2022-08-03 13:01:04 -06:00
Behdad Esfahbod e1b5f2f806 [object] Call destructor in hb_object_destroy() 2022-07-20 15:07:55 -06:00
Behdad Esfahbod 9ea4ab6051 [object] Call constructor 2022-07-20 14:57:32 -06:00
Behdad Esfahbod cd9799784c [vector] Remove old find() method 2022-01-19 11:14:25 -07:00
Behdad Esfahbod 9cc4da962f [object] Remove hb_object_is_inert() 2021-08-16 20:17:53 -06:00
Behdad Esfahbod f6d6eff6a2 [object] Remove unused HB_REFERENCE_COUNT_INIT 2021-08-16 19:41:44 -06:00
Behdad Esfahbod 0e37c07f4c Revert "Construct user_data in hb_object"
This reverts commit a78eb43c79.

See: https://github.com/harfbuzz/harfbuzz/pull/3100#issuecomment-890088227
2021-07-30 12:52:59 -06:00
Ben Wagner a78eb43c79 Construct user_data in hb_object
hb_object's user_data is created lazily. The previous implementation of
hb_object_set_user_data created space for the user_data but did not
actually construct it. This means that hb_user_data_array_t's lock was
not constructed. If hb_mutex_t is backed by an implementation which
requires that it be constructed (not just zero initialized) then errors
will occur when taking the lock when setting the user data.

Change hb_object_set_user_data to construct the user_data in the created
space and hb_object_fini to call the destructor.
2021-07-29 16:03:56 -06:00
Behdad Esfahbod 2337f0d047 Internally use hb_malloc/.../hb_free instead of malloc/.../free
Redefining those stock names as macros was conflicting with gcc 10
headers.

Fixes https://github.com/harfbuzz/harfbuzz/issues/3044
2021-07-08 10:54:09 -07:00
Behdad Esfahbod 140797d4a2 [constexpr] hb_atomic_int_t 2021-02-22 17:19:26 -07:00
Behdad Esfahbod 2ec802b42a [object] Simplify reference_count_t 2021-02-22 17:18:47 -07:00
Behdad Esfahbod 6a45df0a54 Fix -Wambiguous-reversed-operator warning
Fixes https://github.com/harfbuzz/harfbuzz/issues/2554
2020-07-08 18:17:40 -05:00
Ebrahim Byagowi a0b4ac4dce Turn 8 spaces to tab across the project
According to the current code style of the project
2019-08-27 02:40:41 +04:30
Behdad Esfahbod fa333e34d6 [vector] Remove static_array
Was good idea, but with C++ types with constructor/destructor, was getting in
the way as compiler was destructing those items where it was not desired.
Since C++ does not allow zero-sized arrays, just remove it...
2018-12-27 17:56:22 -05:00
Behdad Esfahbod 474a12058d [array/vector] Rename len to length 2018-12-21 18:53:01 -05:00
Ebrahim Byagowi e412008599 Remove redundant void from C++ sources (#1486) 2018-12-17 13:01:01 -05:00
Ebrahim Byagowi b2ebaa9afa Remove redundant 'inline' from methods (#1483) 2018-12-16 14:08:10 -05:00
Behdad Esfahbod 9579ed9755 Make atomic types' internal values non-mutable
This resulted from confusion previously...
2018-11-13 11:46:20 -05:00
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 ee351a38ec [object] Add "writable" 2018-11-03 14:59:40 -04:00
Behdad Esfahbod b186274362 [set/map] Fix uninitialized memory
I keep forgetting that primitive types are NOT initialized during construction. :|
2018-10-29 23:21:14 -07:00
Behdad Esfahbod 35d410f2ba Remove ASSERT_POD
Newer compilers / language allows structs with constructor in union.
So, this was not actually testing anything.  Indeed, the recent
change in DISALLOW_COPY *is* making some of our types non-POD.
That broke some bots.

Just remove this since it wasn't doing much, and I'd rather have
DISALLOW_COPY.
2018-10-29 14:45:44 -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