clang 23 added -Wunused-but-set-global, which fires on the
type_name##_parent_class variable that _G_DEFINE_TYPE_EXTENDED_BEGIN_PRE
emits whenever a type never chains up to its parent:
error: variable 'my_thing_parent_class' set but not used
[-Werror,-Wunused-but-set-global]
Projects that promote the unused-but-set group to an error (pango, for
one) now fail to build with clang 23, and they cannot fix it on their
side because the variable comes from this macro.
Annotate it G_GNUC_UNUSED, the same treatment the adjacent
get_instance_private helper already gets.
Signed-off-by: Sunil Dora <sunilkumar.dora@windriver.com>
Fixes: #4038
MINSIGSTKSZ is only the minimum accepted by sigaltstack().
It does not necessarily provide enough space for the kernel signal
frame and the test signal handler.
Prefer SIGSTKSZ when it is available, while retaining MINSIGSTKSZ
as a fallback. Allow a larger positive _SC_MINSIGSTKSZ value to raise
the allocation, but never let it reduce it.
The `g_local_file_trash` function previously truncated filenames from
the front
on a plain byte boundary when encountering `ENAMETOOLONG`. This could
produce
invalid UTF-8 filenames, causing garbled names in the trash for UTF-
8 locales.
A new helper `truncate_basename_front` is introduced that:
- Truncates from the front, preserving the trailing part (extension)
of the
original name.
- For UTF-8 filenames, skips continuation bytes to align the cut to
a character
boundary, ensuring the result remains valid UTF-8.
- For non-UTF-8 (single-byte or best-effort), falls back to a plain
byte cut.
The code now uses this helper in both the `".trashinfo"` suffix and
`".XXXXXX"`
template cases, removing the duplicated inline logic. The helper returns
0 if
the base name is too short to truncate safely, in which case the
original
`ENAMETOOLONG` error is preserved.
The default splice implementations used 8 KiB buffers. In the
asynchronous implementation, mixed native-async and worker-backed
streams therefore alternated between reading on the main context and
dispatching each small write through the worker pool.
Use 256 KiB buffers for both synchronous and asynchronous splices to
amortize syscall and dispatch overhead. Allocate the synchronous
buffer on the heap to avoid growing the stack.
Use two buffers for asynchronous splices so the next input read can
run while the previous output write drains. Keep at most one operation
outstanding on each stream to preserve their concurrency guarantees
and provide bounded backpressure.
Stop scheduling new operations after the first error, but wait for any
overlapping callback before completing the splice. This keeps task
lifetimes safe and preserves partial-write, cancellation, close, and
error-reporting semantics.
In a local 1 GiB libsoup download benchmark, this reduced asynchronous
splice time from 3.09 seconds to 0.44 seconds.
Add deterministic tests for synchronous bulk copies, asynchronous
buffer overlap, ordering, partial writes, concurrent read and write
failures, cancellation during overlap, and all close-flag
combinations.