changeset 1327:ef16e7c0d402

* alloc.c (Fmemory_limit): New function. (syms_of_alloc): Defsubr it.
author Jim Blandy <jimb@redhat.com>
date Sat, 03 Oct 1992 08:36:49 +0000
parents 709532b86646
children c4eb3aa71303
files src/alloc.c
diffstat 1 files changed, 20 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/src/alloc.c	Sat Oct 03 07:15:35 1992 +0000
+++ b/src/alloc.c	Sat Oct 03 08:36:49 1992 +0000
@@ -2010,6 +2010,25 @@
     }
 }
 
+/* Debugging aids.  */
+
+DEFUN ("memory-limit", Fmemory_limit, Smemory_limit, 0, 0, "",
+  "Return the address of the last byte Emacs has allocated, divided by 1024.\n\
+This may be helpful in debugging Emacs's memory usage.\n\
+If called interactively, print the result in the minibuffer.")
+  ()
+{
+  Lisp_Object end;
+
+  XSET (end, Lisp_Int, (int) sbrk (0));
+
+  if (! NILP (Finteractive_p))
+    message ("Memory limit at %dk.", XINT (end));
+
+  return end;
+}
+
+
 /* Initialization */
 
 init_alloc_once ()
@@ -2100,4 +2119,5 @@
   defsubr (&Smake_marker);
   defsubr (&Spurecopy);
   defsubr (&Sgarbage_collect);
+  defsubr (&Smemory_limit);
 }