gobject: Mute toggle ref notifications for transient ref/unref pairs

Open Daniel van Vugt requested to merge vanvugt/glib:mute-toggles-during-notify into main

The ref/unref that occur in g_object_notify* are very short lived and have a net zero effect on the reference count of the object. So allowing them to trigger toggle notifications was incurring excessive garbage collection in GJS (gnome-shell).

Now we "mute" toggle notifications specifically for those brief references in g_object_notify* so that notifications like the ticking of GnomeWallClock don't indirectly lead to garbage collection runs.

Closes: gnome-shell#4800
Closes: gnome-shell#2085

Edited by Daniel van Vugt

Merge request reports