mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-11-03 01:42:18 +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 ();
|
||||
|
||||
/* if mem free ratio > 0.5, don't signal */
|
||||
if (mem_ratio < 0.0)
|
||||
return G_SOURCE_REMOVE;
|
||||
else if (mem_ratio > 0.5)
|
||||
return G_SOURCE_CONTINUE;
|
||||
/* if the test is running, skip memory ratio test */
|
||||
if (!monitor->proc_override)
|
||||
{
|
||||
/* if mem free ratio > 0.5, don't signal */
|
||||
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);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user