| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
|
| |
GTK lost it's '+' suffix back in 2019, according to
<https://mail.gnome.org/archives/gtk-devel-list/2019-February/msg00000.html>
This commit can be re-generated with:
git grep -l GTK+ \
| grep -v -e ^NEWS -e ^glib/tests/collate.c \
| xargs sed -i 's/GTK+/GTK/g'
Most of the changes are in comments and documentation.
|
|\
| |
| |
| |
| | |
add g_timeout_add_seconds_once
See merge request GNOME/glib!3383
|
| |
| |
| |
| | |
Use timeout_add_full() helper to deduplicate code
|
| |
| |
| |
| |
| | |
Add a new call combing behaviors of g_timeout_add_seconds and
g_timeout_add_once.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
This should hopefully stop the kernel spending a lot of memory and disk
bandwidth creating coredumps for them unnecessarily, which slows down
the rest of the tests and generally wastes resources.
Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
Fixes: #2939
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
This is put together through git archaeology:
```
git log -- glib/tests/assert-msg-test.c tests/assert-msg-test.c
```
The following commits were too trivial to have meaningful copyright:
- 8e59d8602ca5921d78245f5d2b405b517a5e7cf9
- 44c004c84e9080040ff4e0e90b322dda0561cf85
- 207b8cb8a50d68e207d28b59e588311a5cbd9772
- a1bee97d4f093db01dee834bf3292eabd5b13d17
Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
Helps: #1415
|
|/
|
|
| |
Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
|
|
|
|
|
|
|
|
|
|
|
| |
Apparently 3 hashes is too many, and as a result this line is not
displayed properly in the HTML documentation. 2 hashes seems to be
just right, as can be seen with:
$ git grep '^ \* ##' | wc -l
65
$ git grep '^ \* ###' | wc -l
1
|
|
|
|
|
|
|
|
|
| |
Otherwise it might look like it would only start spawning threads when
jobs are enqueued.
Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
Helps: #2958
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
If you’re only quickly looking at the API signature, it looks like
`item_free_func` will be called for all items enqueued to the thread
pool.
As it happens, it’s actually only called for the items which are still
enqueued when the thread pool is destroyed. The user’s `GFunc` is
responsible for freeing items which are successfully dequeued and
processed during the lifetime of the thread pool.
That’s a bit of a gotcha, so document it more explicitly.
Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
|
|\
| |
| |
| |
| |
| |
| | |
gfileutils: Fix potential integer overflow in g_get_current_dir()
Closes #98
See merge request GNOME/glib!3375
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
In practice, this will never happen.
If `getcwd()` returns `ERANGE` whenever the working directory is ≥
`PATH_MAX`, though, the previous implementation of the loop would run
until `max_len == G_MAXULONG`, and would then overflow when adding `1`
to it for a nul terminator in the allocation.
Avoid that problem by always keeping `buffer_len` as a power of two, and
relying on `getcwd()` to write a nul terminator within the buffer space
it’s given. It seems to do this on all platforms we care about, because
the previous version of the code never explicitly wrote a nul terminator
anywhere.
Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
Fixes: #98
|
|\ \
| | |
| | |
| | |
| | | |
glib-unix: Improve documentation for g_unix_fd_source_new()
See merge request GNOME/glib!3396
|
| | |
| | |
| | |
| | |
| | |
| | | |
In particular, document the type of the callback function.
Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
If both __NR_futex and __NR_futex_time64 are defined, g_futex_simple()
will first call futex_time64(). If that fails with ENOSYS, then
futex_time() is called instead. However, errno was not saved and
restored in this case, which would result in g_futex_simple()
returning with errno set to ENOSYS, even if futex_time() succeeded.
|
|\ \ \
| | | |
| | | |
| | | |
| | | | |
Fix small issues in docs
See merge request GNOME/glib!3393
|
| |/ /
| | |
| | |
| | |
| | | |
This will make converting the docs to another format
(say, rst) somewhat easier.
|
|\ \ \
| | | |
| | | |
| | | |
| | | | |
gmain: More explicitly document g_main_context_release() prereqs
See merge request GNOME/glib!3314
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
As with the previous commit.
The logic has to be a little contorted here to avoid leaving the context
locked after emitting the critical warning. Execution does (and should)
continue after a critical warning by default, so we should do our best
to recover.
Inspired by https://gitlab.gnome.org/GNOME/glib/-/merge_requests/3302.
Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
|
| |/ /
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
The documentation was fairly clear before, but we can make it clearer:
it’s a programming error to call `g_main_context_release()` if you have
not received a true return value from `g_main_context_acquire()` before.
Inspired by https://gitlab.gnome.org/GNOME/glib/-/merge_requests/3302.
Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
|
|/ /
| |
| |
| |
| |
| | |
We need a way to initialise refcounted types placed in static storage,
or on the stack. Using proper macros avoids knowing the magic constant
used for grefcount and gatomicrefcount.
|
|\ \
| | |
| | |
| | |
| | | |
gmain: Avoid some lock/unlock dance during g_main_context_iterate
See merge request GNOME/glib!3235
|
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
This should fail and warn but not leaving the context acquired and
locked.
Add tests.
|
| | |
| | |
| | |
| | |
| | | |
We do it during initialization, this may be if necessary handled by GCond in
case we need to acquire the lock.
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
A context iteration we're doing lots of lock/unlocks and that's fine to give
other threads contexts a chance to run, but we're doing it also just to call
other functions that require locking, and this can be avoided.
Other threads can still have a chance to run while releasing the ownership
of the context.
|
|\ \ \
| | | |
| | | |
| | | |
| | | | |
glib/tests/[rec-]mutex: Allow each thread to work
See merge request GNOME/glib!3389
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
In non-perf mode, we were making only one thread to win the race to increase
the value, but since we're launching more threads anyways let's allow
more of them to have a chance to do something, to make the test more
valuable, even if it's still quick enough.
|
| | | |
| | | |
| | | |
| | | | |
The parameter is named 'object_path', not 'string'.
|
|/ / /
| | |
| | |
| | |
| | |
| | |
| | | |
Even though having NULL as nullptr should be the standard for newer C++
versions, it may break some headers, so let's not touch it for now.
Closes: https://gitlab.gnome.org/GNOME/glib/-/issues/2973
|
|\ \ \
| | | |
| | | |
| | | |
| | | | |
meson: Add glib_valgrind_suppressions variable to glib pkg-config file
See merge request GNOME/glib!3361
|
| | | |
| | | |
| | | |
| | | | |
Use more readable and shorter syntax
|
| | | |
| | | |
| | | |
| | | | |
Ensure things are generated as we expect and avoid we regress on that.
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
Various projects are running tests under valgrind, and they are using
the GLib suppresions to avoid false-positive results.
While this is stored in a well-known path for some years, and easy to
figure out from the GLib prefix, it's better to expose it through a
proper pkgconfig variable so that it's easy to get it from any build
system.
|
|\ \ \ \
| | | | |
| | | | |
| | | | |
| | | | | |
gtimer: Avoid doing anything on g_usleep (0)
See merge request GNOME/glib!3381
|
| |/ / /
| | | |
| | | |
| | | |
| | | | |
It's unlikely to happen, but still could be the case, so avoid do
anything.
|
|\ \ \ \
| | | | |
| | | | |
| | | | |
| | | | | |
Work around an UCRT issue with _wspawn() functions taking an envp block
See merge request GNOME/glib!3289
|
| | | | | |
|
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
block argument
We were working around that with a call to chdir("."). Internally chdir()
sets up cmd shell-related environment variables, but only if the current
working directory belongs to a volume with a drive letter. For example,
if the current working directory is on a UNC volume like a network share,
the call to chdir() won't help.
Reference:
https://developercommunity.visualstudio.com/t/UCRT-Crash-in-_wspawne-functions/10262748
|
|\ \ \ \ \
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
Make GVariant/GHash opaque types compatible with CHERI
See merge request GNOME/glib!3146
|
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
For CHERI-enabled architectures such as Arm Morello we have to align the
GVariantIter to pointer alignment (16 bytes for Morello) but defining the
opaque struct as 16 gsize elements only aligns to 8 bytes.
This does not change the layout for existing architecutre since there
gsize is the same as guintptr.
Helps: https://gitlab.gnome.org/GNOME/glib/-/issues/2842
|
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
The code for SMALL_ENTRY_SIZE assumes pointers are no larger than 8 bytes,
so instead of trying to make it work disable the optimization for now.
Helps: https://gitlab.gnome.org/GNOME/glib/-/issues/2842
Co-authored-by: Graeme Jenkinson <graeme@capabilitieslimited.co.uk>
|
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
Use guinptr instead if gsize. While this increases the structure size
for Morello, it is still only 256 bytes which should not matter for a
type where we expect few instances to exist at any given time.
This does not increase the size for existing architectures since gsize
is the same as guintptr for all of them.
Helps: https://gitlab.gnome.org/GNOME/glib/-/issues/2842
|
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
Last field needs to be pointer-size to match GHashTableIter. This happened
to work for most architecture due to alignment padding/pointer size, but
for CHERI targets with 128-bit pointers RealIter ends up being smaller
than GHashTableIter.
Helps: https://gitlab.gnome.org/GNOME/glib/-/issues/2842
|
|\ \ \ \ \ \
| |_|/ / / /
|/| | | | |
| | | | | |
| | | | | | |
g_utf8_normalize: don't read past the end of the buffer
See merge request GNOME/glib!3341
|
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
Add three classes of test case for which g_utf8_normalize() should
safely return NULL:
- Strings ending with a truncated multibyte character which would
extend past the NUL terminator
- Strings ending with a multibyte character which extends past the
length limit provided by the max_len argument
- Strings containing an invalid multibyte character in any position
|
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
_g_utf8_normalize_wc() could read past the end of the provided buffer if
it ends with a truncated multibyte character. If max_len is -1, it can
continue reading until it encounters either a NUL or unreadable
memory. Avoid this with extra bounds checks prior to g_utf8_get_char()
to ensure that it does not read past either max_len or a NUL
terminator.
|
|\ \ \ \ \ \
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | | |
tests: Re-enable mainloop test under AddressSanitizer
Closes #2307
See merge request GNOME/glib!3329
|
| |/ / / / /
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
This is a partial revert of commit f378352051.
The leak of a `GMainLoop` which prompted it has been fixed by commit
4f5da8338127e25e5ebb54f5a4a95ffc2e40adcc in merge request !2535.
Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
See: #2598
Fixes: #2307
|
|\ \ \ \ \ \
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | | |
gsocket/inotify/gwakeup: Use SOCK_NONBLOCK and O_NONBLOCK to avoid fcntl() syscalls where possible
See merge request GNOME/glib!3347
|
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | | |
Create the wakeup pipe using the `O_NONBLOCK` flag for `pipe2()`, where
possible.
This saves a couple of `fcntl()` syscalls every time a wakeup pipe is
created, which is at least once per `GMainContext`.
This uses the `O_NONBLOCK` support added to `g_unix_open_pipe()` in the
previous commit.
Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
|