comparison src/alloc.c @ 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 0edeba6fc9fc
children 4bea5980f778
comparison
equal deleted inserted replaced
1326:709532b86646 1327:ef16e7c0d402
2008 else 2008 else
2009 from_sb = to_sb; 2009 from_sb = to_sb;
2010 } 2010 }
2011 } 2011 }
2012 2012
2013 /* Debugging aids. */
2014
2015 DEFUN ("memory-limit", Fmemory_limit, Smemory_limit, 0, 0, "",
2016 "Return the address of the last byte Emacs has allocated, divided by 1024.\n\
2017 This may be helpful in debugging Emacs's memory usage.\n\
2018 If 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
2015 init_alloc_once () 2034 init_alloc_once ()
2016 { 2035 {
2017 /* Used to do Vpurify_flag = Qt here, but Qt isn't set up yet! */ 2036 /* Used to do Vpurify_flag = Qt here, but Qt isn't set up yet! */
2098 defsubr (&Srope_elt); 2117 defsubr (&Srope_elt);
2099 defsubr (&Smake_symbol); 2118 defsubr (&Smake_symbol);
2100 defsubr (&Smake_marker); 2119 defsubr (&Smake_marker);
2101 defsubr (&Spurecopy); 2120 defsubr (&Spurecopy);
2102 defsubr (&Sgarbage_collect); 2121 defsubr (&Sgarbage_collect);
2103 } 2122 defsubr (&Smemory_limit);
2123 }