This might be the default, but let’s be explicit about it, since the
non-nullability of the return value is explicitly mentioned in the prose
of the documentation.
This contrasts with the `(nullable)` on the return value of
`g_main_context_get_thread_default()`.
Signed-off-by: Philip Withnall <pwithnall@gnome.org>
In the case where mimeapps.list is a symlink, gio-issued updates would
overwrite the file, destroying the symlink in the process.
Instead, this approach recursively follows mimeapps.list symlinks
and overwites the contents of the final file instead.
Closes#3579
The g_array_binary_search function does not necessarily return the index
of the first instance within the array. If the sentence is read as "the
first encountered instance", then it would be correct but not helpful.
Drop the statement and keep the code as it is.
It’s possible for the dispatch of the timeout source to race with the
finalisation of the `GMemoryMonitorPoll`, given that the timeout is run
in the GLib worker thread.
Protect against that by holding a thread-safe weak ref on the
`GMemoryMonitor` in the callback data.
Signed-off-by: Philip Withnall <pwithnall@gnome.org>
Fixes: #3758
If string operations get the length G_MAXSIZE passed (which cannot
ever be true because terminating NUL byte would not fit), return NULL
instead of triggering out of boundary writes.
Add explicitly transfer full annotation to g_hook_ref. Without it,
the gir file and generated documentations pretend that returned
value is owned by the called function (transfer none) which is not
correct.
- Set return values to transfer none if they are passed in arguments
- Add scope call annotation for parameter function
- Take ownership in free/unref functions
- Add nullable annotations where appropriate
- Index functions do not pass ownership
- Add copy-func/free-func annotations
- Remove periods from parameter descriptions
- Start parameter descriptions lower case
- Shorten nullable parameter descriptions
- Start parameter descriptions with a/the
- Start boolean action descriptions with if
- Start return value description with "The"
- Adjust boolean return value descriptions
- Skip type in parameter description
Deviate from the GNOME Developer Documentation
guidelines only in special cases to deliver more information:
https://developer.gnome.org/documentation/guidelines/devel-docs.html#callable-symbols
He’s made a lot of detailed contributions recently, and has a good
understanding of large parts of GObject.
I‘ve asked him (by private email) if he’d agree to be added to the
co-maintainers list, and he said he’d be pleased to.
Signed-off-by: Philip Withnall <pwithnall@gnome.org>
Try to avoid casting variables to potentially smaller types to fit
defined probes. This can truncate values and lead to wrong results.
Also make sure that signedness matches.
Since GType can be even 128 bit on CHERI architecture, cast all these
various types used based on platform to uintmax_t which SystemTap
properly processes.
It’s not particularly clear why both these exist and why you need to use
both of them when creating a `GValue` — but you do.
Try and clarify things in the documentation.
In particular, replace use of the term ‘uninitialised’ (referring to a
`GValue` which has been set to `G_VALUE_INIT` but not yet had
`g_value_init()` called on it) with ‘zero-filled (cleared)’ instead.
‘uninitialised’ doesn’t make sense to describe a variable which, in C
terms, has just been initialised by assigning `G_VALUE_INIT` to it.
‘cleared’ is a bit less overloaded as a term.
Add some code examples to hopefully make things clearer too.
Signed-off-by: Philip Withnall <pwithnall@gnome.org>
Development versions of glib like 2.85.2 produce library files with
names like "libglib-2.0.so.0.8502.0" whereas stable version names
are like "libglib-2.0.so.0.8400.2".
The produced stp files for SystemTap work for stable versions but not
for development versions.
Fix this by passing the correct variables into LT_CURRENT and
LT_REVISION.