aboutsummaryrefslogtreecommitdiffstats
path: root/src/alloc.c
diff options
context:
space:
mode:
authorJim Blandy1992-10-03 08:36:49 +0000
committerJim Blandy1992-10-03 08:36:49 +0000
commit20d2471455526acfd5fe96681ea31f0eac88fae4 (patch)
tree3321496047c0731b445bf04836910654ee6a909b /src/alloc.c
parentff06df24f66c15bf1649072427414f8f190226ec (diff)
downloademacs-20d2471455526acfd5fe96681ea31f0eac88fae4.tar.gz
emacs-20d2471455526acfd5fe96681ea31f0eac88fae4.zip
* alloc.c (Fmemory_limit): New function.
(syms_of_alloc): Defsubr it.
Diffstat (limited to 'src/alloc.c')
-rw-r--r--src/alloc.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/alloc.c b/src/alloc.c
index ead83fe0fb4..dcdbd65d85e 100644
--- a/src/alloc.c
+++ b/src/alloc.c
@@ -2010,6 +2010,25 @@ compact_strings ()
2010 } 2010 }
2011} 2011}
2012 2012
2013/* Debugging aids. */
2014
2015DEFUN ("memory-limit", Fmemory_limit, Smemory_limit, 0, 0, "",
2016 "Return the address of the last byte Emacs has allocated, divided by 1024.\n\
2017This may be helpful in debugging Emacs's memory usage.\n\
2018If called interactively, print the result in the minibuffer.")
2019 ()
2020{
2021 Lisp_Object end;
2022
2023 XSET (end, Lisp_Int, (int) sbrk (0));
2024
2025 if (! NILP (Finteractive_p))
2026 message ("Memory limit at %dk.", XINT (end));
2027
2028 return end;
2029}
2030
2031
2013/* Initialization */ 2032/* Initialization */
2014 2033
2015init_alloc_once () 2034init_alloc_once ()
@@ -2100,4 +2119,5 @@ which includes both saved text and other data.");
2100 defsubr (&Smake_marker); 2119 defsubr (&Smake_marker);
2101 defsubr (&Spurecopy); 2120 defsubr (&Spurecopy);
2102 defsubr (&Sgarbage_collect); 2121 defsubr (&Sgarbage_collect);
2122 defsubr (&Smemory_limit);
2103} 2123}