mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-11-04 18:18:56 +01:00
gio: gmemorymonitorpsi: Fix test error since memory free ratio test can be skipped when performing the test
The memory free ratio test can be skipped when we run the test. If proc_override is TRUE and proc path is overridden, the memory free ratio test can be skipped.
This commit is contained in:
@@ -178,11 +178,15 @@ g_memory_monitor_low_trigger_cb (GMemoryMonitorPsi *monitor,
|
|||||||
|
|
||||||
mem_ratio = g_memory_monitor_base_query_mem_ratio ();
|
mem_ratio = g_memory_monitor_base_query_mem_ratio ();
|
||||||
|
|
||||||
/* if mem free ratio > 0.5, don't signal */
|
/* if the test is running, skip memory ratio test */
|
||||||
if (mem_ratio < 0.0)
|
if (!monitor->proc_override)
|
||||||
return G_SOURCE_REMOVE;
|
{
|
||||||
else if (mem_ratio > 0.5)
|
/* if mem free ratio > 0.5, don't signal */
|
||||||
return G_SOURCE_CONTINUE;
|
if (mem_ratio < 0.0)
|
||||||
|
return G_SOURCE_REMOVE;
|
||||||
|
if (mem_ratio > 0.5)
|
||||||
|
return G_SOURCE_CONTINUE;
|
||||||
|
}
|
||||||
|
|
||||||
g_memory_monitor_base_send_event_to_user (G_MEMORY_MONITOR_BASE (monitor), level_type);
|
g_memory_monitor_base_send_event_to_user (G_MEMORY_MONITOR_BASE (monitor), level_type);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user