- 19 Oct, 2020 4 commits
-
-
Philip Withnall authored
Signed-off-by:
Philip Withnall <pwithnall@endlessos.org>
-
Sebastian Dröge authored
Backport !1706 “Add various missing nullable annotations” to glib-2-66 See merge request !1710
-
Sebastian Dröge authored
Backport !1683 “Fix the 6-days-until-the-end-of-the-month bug” to glib-2-66 See merge request !1705
-
-
- 16 Oct, 2020 5 commits
-
-
The addition causes the date to shift forward into 1st of the next month, because a 0-based offset is compared to be "more than" the days in the month instead of "more than or equal to". This is triggered by corner-cases where transition date is 6 days off the end of the month and our calculations put it at N+1th day of the month (where N is the number of days in the month). The subtraction should be triggered to move the date back a week, putting it 6 days off the end; for example, October 25 for CET DST transition; but due to incorrect comparison the date isn't shifted back, we add 31 days to October 1st and end up at November 1st). Fixes issue #2215.
-
-
Emmanuele Bassi authored
Backport !1661 “Lookup fallback time zones in the cache to improve performance” to glib-2-66 See merge request !1700
-
Sebastian Dröge authored
Backport !1698 “gslice: Inline win32 implementation of g_getenv() to avoid deadlock” to glib-2-66 See merge request !1702
-
Philip Withnall authored
The win32 implementation of `g_getenv()` uses GSlice (from within GQuark), which results in a deadlock when examining the `G_SLICE` environment variable. Fix that by inlining a basic implementation of `g_getenv()` at that call site. Signed-off-by:
Philip Withnall <pwithnall@endlessos.org> Fixes: #2225
-
- 15 Oct, 2020 5 commits
-
-
Philip Withnall authored
This tests the previous few commits. Signed-off-by:
Philip Withnall <pwithnall@endlessos.org>
-
This reverts commit 851241f1. That commit avoids a performance regression but introduces a behavior regression: changes to /etc/localtime have no effect for the remaining of the application's runtime. With the optimization introduced by the previous commit, we can pass NULL to g_time_zone_new() repeatedly with no performance drawback, so we no longer have to workaround this case. Fixes: #2224
-
We cache GTimeZone instances to avoid expensive construction when the same id is requested again. However, if the NULL id is passed to g_time_zone_new(), we always construct a new instance for the default/fallback timezone. With the recent introduction of some heavy calculations[1], repeated instance construction in such cases has visible performance impact in nautilus list view and other such GtkTreeView consumers. To avoid this, cache reference to a constructed default timezone and use it the next time g_time_zone_new() is called with NULL argument, as long as the default identifier doesn't change. We already did the same for the local timezone[2]. Fixes: #2204 Based on idea proposed by Sebastian Keller <skeller@gnome.org>. [1] 25d950b6 [2] 551e8366
-
We have been passing a &resolved_identifier address around for multiple functions to set it. Each function may either: 1. leaving it for the next function to set, if returning early; 2. set it to a duplicate of the passed identifier, if not NULL; 3. get a fallback value and set it, otherwise. This can be simplified by setting it early to either: 1. a duplicate of the passed identifier, if not NULL; 2. a fallback value, otherwise. This way we can avoid some unnecessary string duplication and freeing. Also, on Windows, we avoid calling windows_default_tzname() twice. But the main motivation for this change is enabling the performance optimization in the next commit.
-
When the TZ environment variable is not set, we get the local timezone identifier by reading specific files. We are going to need these identifiers earlier, so split this logic into its own function, in preparation for the next commit. Based on idea proposed by Sebastian Keller <skeller@gnome.org>.
-
- 14 Oct, 2020 4 commits
-
-
Sebastian Dröge authored
Backport !1691 “gmain: Fix possible locking issue in source unref” to glib-2-66 See merge request !1693
-
Sebastian Dröge authored
Backport !1692 “gsignal: Plug g_signal_connect_object leak” to glib-2-66 See merge request !1694
-
commit 916297be added a hash table to provide constant time lookups of signal handlers. Unfortunately, that commit neglected to remove handlers from g_signal_connect_object calls from the hash table that are disconnected implicitly when the associated object goes away. This commit addresses that bug by changing the closure invalidate handler associated with the signal connection to properly remove the handler from the hash table.
-
When unref'ing child sources, the lock is already held. But instead of passing TRUE to g_source_unref_internal it currently passes whether the lock was already held outside of the current invocation. Just pass TRUE to fix this possible issue.
-
- 13 Oct, 2020 3 commits
-
-
-
Sebastian Dröge authored
uri: add missing (not)nullable annotations See merge request !1689
-
As suggested by Sebastian Dröge: https://github.com/gtk-rs/glib/pull/697#pullrequestreview-505797722 Signed-off-by:
Marc-André Lureau <marcandre.lureau@redhat.com>
-
- 12 Oct, 2020 1 commit
-
-
- 11 Oct, 2020 1 commit
-
-
- 07 Oct, 2020 3 commits
-
-
Sebastian Dröge authored
Backport !1684 “glocalfileinfo: Fix use of fstatat() on macOS < 10.10” to glib-2-66 See merge request !1685
-
Philip Withnall authored
`g_local_file_fstatat()` needs to fall back to returning an error if `fstatat()` isn’t defined, which is the case on older versions of macOS (as well as Windows, which was already handled). Callers shouldn’t call `g_local_file_fstatat()` in these cases. (That’s already the case.) Signed-off-by:
Philip Withnall <pwithnall@endlessos.org> Fixes: #2203
-
Sebastian Dröge authored
Backport !1680 “guri: Fix UTF-8 validation when escaping URI components” to glib-2-66 See merge request !1682
-
- 05 Oct, 2020 3 commits
-
-
Philip Withnall authored
These bump up the code coverage. Signed-off-by:
Philip Withnall <pwithnall@endlessos.org>
-
Philip Withnall authored
The return value from `g_utf8_get_char_validated()` is a `gunichar`, which is unsigned, so comparing it with `> 0` is always going to return true, even for return values `(gunichar) -1` and `(gunichar) -2`, which indicate errors. Handle them more explicitly. oss-fuzz#26083 Signed-off-by:
Philip Withnall <pwithnall@endlessos.org>
-
Philip Withnall authored
This will allow more tests to be added easily in future. It introduces no functional changes. Signed-off-by:
Philip Withnall <pwithnall@endlessos.org>
-
- 01 Oct, 2020 5 commits
-
-
Philip Withnall authored
Signed-off-by:
Philip Withnall <pwithnall@endlessos.org>
-
Sebastian Dröge authored
gdatetime: Avoid integer overflow creating dates too far in the past See merge request !1671
-
Philip Withnall authored
This is exactly the test case from oss-fuzz which triggers a negative overflow when constructing dates. oss-fuzz#22758 Signed-off-by:
Philip Withnall <pwithnall@endlessos.org>
-
Philip Withnall authored
oss-fuzz#22758 Signed-off-by:
Philip Withnall <pwithnall@endlessos.org>
-
Philip Withnall authored
guri: Fix URI scope parsing See merge request !1669
-
- 30 Sep, 2020 6 commits
-
-
Philip Withnall authored
This bumps the coverage of `parse_host()` and `parse_ip_literal()` up to 100% of lines and branches. Signed-off-by:
Philip Withnall <pwithnall@endlessos.org>
-
Philip Withnall authored
This introduces no tests for failed parsing *yet*, but will allow them to be added in future. Signed-off-by:
Philip Withnall <pwithnall@endlessos.org>
-
Philip Withnall authored
The previous parsing code could read off the end of a URI if it had an incorrect %-escaped character in. Fix that, and more closely implement parsing for the syntax defined in RFC 6874, which is the amendment to RFC 3986 which specifies zone ID syntax. This requires reworking some network-address tests, which were previously treating zone IDs incorrectly. oss-fuzz#23816 Signed-off-by:
Philip Withnall <pwithnall@endlessos.org>
-
Philip Withnall authored
Signed-off-by:
Philip Withnall <pwithnall@endlessos.org>
-
Philip Withnall authored
Having the goto labels at the bottom of a function makes things a little more readable. This introduces no functional changes. Signed-off-by:
Philip Withnall <pwithnall@endlessos.org>
-
Philip Withnall authored
This introduces no functional changes, but makes the memory ownership a little clearer and reduces the length of the code. Signed-off-by:
Philip Withnall <pwithnall@endlessos.org>
-