NetworkManager/shared/nm-glib-aux
Thomas Haller 6b18fc252d
shared: add nm_g_{idle,timeout}_add_source() helpers
We have g_idle_add() and g_timeout_add(). But these return
those odd guint source ids. That is totally pointless. The
only potential benefit is that a guint is only 4 bytes while
a pointer is 8 bytes (on 64 bit systems). Otherwise, it seems
always preferable to have an actual GSource instance instead
of an integer. It also saves the overhead in g_source_remove()
which first needs to do a hash lookup to find the GSource.
A GSource instance would theoretically work with multiple
GMainContext instances, while g_source_remove() only works
wit g_main_context_default().

On the other hand we have helper API like nm_g_idle_source_new()
and nm_g_timeout_source_new(), which is fully flexible and sensible
because it returns a reference to the GSource instance. However, it
is a bit verbose to use in the common case.

Add helper functions that simplify the use and are conceptionally
similar to g_{idle,timeout}_add() (hence the name).
2021-01-27 10:18:13 +01:00
..
tests shared: fix unit tests for nm_utils_get_next_realloc_size() 2021-01-12 09:56:43 +01:00
nm-c-list.h all: update deprecated SPDX license identifiers 2021-01-05 09:46:21 +01:00
nm-dbus-aux.c all: update deprecated SPDX license identifiers 2021-01-05 09:46:21 +01:00
nm-dbus-aux.h all: update deprecated SPDX license identifiers 2021-01-05 09:46:21 +01:00
nm-dedup-multi.c all: update deprecated SPDX license identifiers 2021-01-05 09:46:21 +01:00
nm-dedup-multi.h all: update deprecated SPDX license identifiers 2021-01-05 09:46:21 +01:00
nm-enum-utils.c shared: fix _nm_utils_enum_from_str_full() for negative enum values 2021-01-15 09:36:30 +01:00
nm-enum-utils.h all: update deprecated SPDX license identifiers 2021-01-05 09:46:21 +01:00
nm-errno.c all: update deprecated SPDX license identifiers 2021-01-05 09:46:21 +01:00
nm-errno.h all: update deprecated SPDX license identifiers 2021-01-05 09:46:21 +01:00
nm-glib.h all: update deprecated SPDX license identifiers 2021-01-05 09:46:21 +01:00
nm-hash-utils.c all: update deprecated SPDX license identifiers 2021-01-05 09:46:21 +01:00
nm-hash-utils.h all: update deprecated SPDX license identifiers 2021-01-05 09:46:21 +01:00
nm-io-utils.c all: update deprecated SPDX license identifiers 2021-01-05 09:46:21 +01:00
nm-io-utils.h all: update deprecated SPDX license identifiers 2021-01-05 09:46:21 +01:00
nm-jansson.h all: update deprecated SPDX license identifiers 2021-01-05 09:46:21 +01:00
nm-json-aux.c all: update deprecated SPDX license identifiers 2021-01-05 09:46:21 +01:00
nm-json-aux.h all: update deprecated SPDX license identifiers 2021-01-05 09:46:21 +01:00
nm-keyfile-aux.c all: update deprecated SPDX license identifiers 2021-01-05 09:46:21 +01:00
nm-keyfile-aux.h all: update deprecated SPDX license identifiers 2021-01-05 09:46:21 +01:00
nm-logging-base.c all: update deprecated SPDX license identifiers 2021-01-05 09:46:21 +01:00
nm-logging-base.h all: update deprecated SPDX license identifiers 2021-01-05 09:46:21 +01:00
nm-logging-fwd.h all: update deprecated SPDX license identifiers 2021-01-05 09:46:21 +01:00
nm-macros-internal.h shared: add nm_strdup_maybe_a() helper macro 2021-01-15 09:36:30 +01:00
nm-obj.h all: update deprecated SPDX license identifiers 2021-01-05 09:46:21 +01:00
nm-random-utils.c all: update deprecated SPDX license identifiers 2021-01-05 09:46:21 +01:00
nm-random-utils.h all: update deprecated SPDX license identifiers 2021-01-05 09:46:21 +01:00
nm-ref-string.c all: update deprecated SPDX license identifiers 2021-01-05 09:46:21 +01:00
nm-ref-string.h all: update deprecated SPDX license identifiers 2021-01-05 09:46:21 +01:00
nm-secret-utils.c all: update deprecated SPDX license identifiers 2021-01-05 09:46:21 +01:00
nm-secret-utils.h all: update deprecated SPDX license identifiers 2021-01-05 09:46:21 +01:00
nm-shared-utils.c shared: stack allocate GPollFD array in _ctx_integ_source_prepare() 2021-01-25 15:58:42 +01:00
nm-shared-utils.h shared: add nm_g_{idle,timeout}_add_source() helpers 2021-01-27 10:18:13 +01:00
nm-str-buf.h shared: add nm_str_buf_append_{dirty,c_len}() helpers 2021-01-14 10:38:52 +01:00
nm-time-utils.c all: update deprecated SPDX license identifiers 2021-01-05 09:46:21 +01:00
nm-time-utils.h all: update deprecated SPDX license identifiers 2021-01-05 09:46:21 +01:00
nm-value-type.h all: update deprecated SPDX license identifiers 2021-01-05 09:46:21 +01:00