emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

master 621bb79: New debugging command 'malloc-info'


From: Eli Zaretskii
Subject: master 621bb79: New debugging command 'malloc-info'
Date: Tue, 10 Nov 2020 12:42:06 -0500 (EST)

branch: master
commit 621bb79b7044dcc277386eb7338c0eb1e08c29c7
Author: Eli Zaretskii <eliz@gnu.org>
Commit: Eli Zaretskii <eliz@gnu.org>

    New debugging command 'malloc-info'
    
    * src/alloc.c (Fmalloc_info) [GNU_LINUX]: New command.
    (syms_of_alloc): Defsubr it.  (Bug#43389)
---
 src/alloc.c | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)

diff --git a/src/alloc.c b/src/alloc.c
index f90d092..2b3643e 100644
--- a/src/alloc.c
+++ b/src/alloc.c
@@ -7194,6 +7194,20 @@ Frames, windows, buffers, and subprocesses count as 
vectors
                make_int (strings_consed));
 }
 
+#ifdef GNU_LINUX
+DEFUN ("malloc-info", Fmalloc_info, Smalloc_info, 0, 0, "",
+       doc: /* Report malloc information to stderr.
+This function outputs to stderr an XML-formatted
+description of the current state of the memory-allocation
+arenas.  */)
+  (void)
+{
+  if (malloc_info (0, stderr))
+    error ("malloc_info failed: %s", emacs_strerror (errno));
+  return Qnil;
+}
+#endif
+
 static bool
 symbol_uses_obj (Lisp_Object symbol, Lisp_Object obj)
 {
@@ -7538,6 +7552,9 @@ N should be nonnegative.  */);
   defsubr (&Sgarbage_collect);
   defsubr (&Smemory_info);
   defsubr (&Smemory_use_counts);
+#ifdef GNU_LINUX
+  defsubr (&Smalloc_info);
+#endif
   defsubr (&Ssuspicious_object);
 
   Lisp_Object watcher;



reply via email to

[Prev in Thread] Current Thread [Next in Thread]