diff options
author | Bastien Nocera <hadess@hadess.net> | 2019-11-21 10:32:39 +0100 |
---|---|---|
committer | Bastien Nocera <hadess@hadess.net> | 2019-12-11 14:37:12 +0100 |
commit | d2b48963894c0ee1a34b22632f8df9f66f274b5b (patch) | |
tree | bd3eedf93a0fde6318d0461b4f8cb93805d139b0 | |
parent | 9a7f55c1e7a8bc2e2c0a1e3f8326e6fd17823205 (diff) | |
download | gobject-introspection-d2b48963894c0ee1a34b22632f8df9f66f274b5b.tar.gz |
Add GMemoryMonitor to glib annotations
-rw-r--r-- | gir/gio-2.0.c | 72 |
1 files changed, 72 insertions, 0 deletions
diff --git a/gir/gio-2.0.c b/gir/gio-2.0.c index 935e1e99..e6d9da15 100644 --- a/gir/gio-2.0.c +++ b/gir/gio-2.0.c @@ -2111,6 +2111,42 @@ /** + * GMemoryMonitor: + * + * #GMemoryMonitor monitors system memory and indicates when + * the system is low on memory. + * + * Since: 2.64 + */ + + +/** + * GMemoryMonitor::low-memory-warning: + * @monitor: a #GMemoryMonitor + * @level: the #GMemoryMonitorWarningLevel warning level + * + * Emitted when the system is running low on free memory. The signal + * handler should then take the appropriate action depending on the + * warning level. See the #GMemoryMonitorWarningLevel documentation for + * details. + * + * Since: 2.64 + */ + + +/** + * GMemoryMonitorInterface: + * @g_iface: The parent interface. + * @low_memory_warning: the virtual function pointer for the + * #GMemoryMonitor::low-memory-warning signal. + * + * The virtual function table for #GMemoryMonitor. + * + * Since: 2.64 + */ + + +/** * GMemoryOutputStream:data: * * Pointer to buffer where data will be written. @@ -6889,6 +6925,32 @@ /** + * SECTION:gmemorymonitor + * @title: GMemoryMonitor + * @short_description: Memory usage monitor + * @include: gio/gio.h + * + * #GMemoryMonitor will monitor system memory and suggest to the application + * when to free memory so as to leave more room for other applications. + * It is implemented on Linux using the [Low Memory Monitor](https://gitlab.freedesktop.org/hadess/low-memory-monitor/) + * ([API documentation](https://hadess.pages.freedesktop.org/low-memory-monitor/)). + * + * There is also an implementation for use inside Flatpak sandboxes. + * + * Possible actions to take when the signal is received are: + * - Free caches + * - Save files that haven't been looked at in a while to disk, ready to be reopened when needed + * - Run a garbage collection cycle + * - Try and compress fragmented allocations + * - Exit on idle if the process has no reason to stay around + * + * See #GMemoryMonitorWarningLevel for details on the various warning levels. + * + * Since: 2.64 + */ + + +/** * SECTION:gmemoryoutputstream * @short_description: Streaming output operations on memory chunks * @include: gio/gio.h @@ -27308,6 +27370,16 @@ /** + * g_memory_monitor_dup_default: + * + * Gets a reference to the default #GMemoryMonitor for the system. + * + * Returns: (transfer full): a new reference to the default #GMemoryMonitor + * Since: 2.64 + */ + + +/** * g_memory_output_stream_get_data: * @ostream: a #GMemoryOutputStream * |