From 1cb020890b7c9188222b350075df8465f19f4c2b Mon Sep 17 00:00:00 2001 From: Max Horn Date: Sun, 8 Jan 2017 20:24:05 +0100 Subject: [PATCH] lib: add warning to MemoryUsage for external objects --- lib/memusage.gi | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/lib/memusage.gi b/lib/memusage.gi index 13651cba8e..bc3cb3e0b4 100644 --- a/lib/memusage.gi +++ b/lib/memusage.gi @@ -123,6 +123,12 @@ InstallMethod( MemoryUsage, "generic fallback method", mem := mem + MemoryUsage(s); fi; od; + elif TNUM_OBJ_INT(o) >= FIRST_EXTERNAL_TNUM then + # Since we are in the fallback method, clearly there is no + # MemoryUsage method installed for the given object. + Info(InfoWarning, 1, "No MemoryUsage method installed for ", + TNUM_OBJ(o)[2], + ", reported usage may be too low" ); fi; MU_Finalize(); return mem;