docs: Move the GMemoryMonitor SECTION

Move it to the struct docs.

Signed-off-by: Philip Withnall <philip@tecnocode.co.uk>

Helps: #3037
This commit is contained in:
Philip Withnall 2023-10-23 13:42:12 +01:00
parent 663f1a64f6
commit 5ce7e8c4f9

View File

@ -31,14 +31,12 @@
#include "gtask.h"
/**
* SECTION:gmemorymonitor
* @title: GMemoryMonitor
* @short_description: Memory usage monitor
* @include: gio/gio.h
* GMemoryMonitor:
*
* #GMemoryMonitor will monitor system memory and suggest to the application
* `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/)
* 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.
@ -46,11 +44,11 @@
* 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
* - Save files that havent 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
* - Call [`malloc_trim(3)`](man:malloc_trim) to return cached heap pages to
* - Call [`malloc_trim(3)`](man:malloc_trim(3)) to return cached heap pages to
* the kernel (if supported by your libc)
*
* Note that some actions may not always improve system performance, and so
@ -58,9 +56,10 @@
* make future heap allocations slower (due to releasing cached heap pages back
* to the kernel).
*
* See #GMemoryMonitorWarningLevel for details on the various warning levels.
* See [type@Gio.MemoryMonitorWarningLevel] for details on the various warning
* levels.
*
* |[<!-- language="C" -->
* ```c
* static void
* warning_cb (GMemoryMonitor *m, GMemoryMonitorWarningLevel level)
* {
@ -78,19 +77,10 @@
* G_CALLBACK (warning_cb), NULL);
* return m;
* }
* ]|
* ```
*
* Don't forget to disconnect the #GMemoryMonitor::low-memory-warning
* signal, and unref the #GMemoryMonitor itself when exiting.
*
* Since: 2.64
*/
/**
* GMemoryMonitor:
*
* #GMemoryMonitor monitors system memory and indicates when
* the system is low on memory.
* Dont forget to disconnect the [signal@Gio.MemoryMonitor::low-memory-warning]
* signal, and unref the `GMemoryMonitor` itself when exiting.
*
* Since: 2.64
*/