aboutsummaryrefslogtreecommitdiffstats
path: root/src/alloc.c
diff options
context:
space:
mode:
authorEli Zaretskii2020-11-10 19:41:04 +0200
committerEli Zaretskii2020-11-10 19:41:04 +0200
commit621bb79b7044dcc277386eb7338c0eb1e08c29c7 (patch)
tree8d611523721c81c0ed5401da5bced0ee0c9cfe1d /src/alloc.c
parentbce00552654b603bcea665cd53d08fd60e86772f (diff)
downloademacs-621bb79b7044dcc277386eb7338c0eb1e08c29c7.tar.gz
emacs-621bb79b7044dcc277386eb7338c0eb1e08c29c7.zip
New debugging command 'malloc-info'
* src/alloc.c (Fmalloc_info) [GNU_LINUX]: New command. (syms_of_alloc): Defsubr it. (Bug#43389)
Diffstat (limited to 'src/alloc.c')
-rw-r--r--src/alloc.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/alloc.c b/src/alloc.c
index f90d09265d0..2b3643e35bd 100644
--- a/src/alloc.c
+++ b/src/alloc.c
@@ -7194,6 +7194,20 @@ Frames, windows, buffers, and subprocesses count as vectors
7194 make_int (strings_consed)); 7194 make_int (strings_consed));
7195} 7195}
7196 7196
7197#ifdef GNU_LINUX
7198DEFUN ("malloc-info", Fmalloc_info, Smalloc_info, 0, 0, "",
7199 doc: /* Report malloc information to stderr.
7200This function outputs to stderr an XML-formatted
7201description of the current state of the memory-allocation
7202arenas. */)
7203 (void)
7204{
7205 if (malloc_info (0, stderr))
7206 error ("malloc_info failed: %s", emacs_strerror (errno));
7207 return Qnil;
7208}
7209#endif
7210
7197static bool 7211static bool
7198symbol_uses_obj (Lisp_Object symbol, Lisp_Object obj) 7212symbol_uses_obj (Lisp_Object symbol, Lisp_Object obj)
7199{ 7213{
@@ -7538,6 +7552,9 @@ N should be nonnegative. */);
7538 defsubr (&Sgarbage_collect); 7552 defsubr (&Sgarbage_collect);
7539 defsubr (&Smemory_info); 7553 defsubr (&Smemory_info);
7540 defsubr (&Smemory_use_counts); 7554 defsubr (&Smemory_use_counts);
7555#ifdef GNU_LINUX
7556 defsubr (&Smalloc_info);
7557#endif
7541 defsubr (&Ssuspicious_object); 7558 defsubr (&Ssuspicious_object);
7542 7559
7543 Lisp_Object watcher; 7560 Lisp_Object watcher;