diff options
| author | Paul Eggert | 2018-06-16 08:11:37 -0700 |
|---|---|---|
| committer | Paul Eggert | 2018-06-16 08:33:36 -0700 |
| commit | ec1b4d9a51db61b77c3953f3de4339f34e512c42 (patch) | |
| tree | 2cddf82b4305deb006bd12423b6664d2e1d38dc5 /src/alloc.c | |
| parent | 9af399fd803ac1ca79f319945b9745b5b96122e7 (diff) | |
| download | emacs-ec1b4d9a51db61b77c3953f3de4339f34e512c42.tar.gz emacs-ec1b4d9a51db61b77c3953f3de4339f34e512c42.zip | |
Rewrite memory-limit in Lisp
Have it return Emacs virtual memory size, not the sbrk value
which is often useless newadays.
* doc/lispref/internals.texi (Garbage Collection):
* etc/NEWS: Document this.
* lisp/subr.el (memory-limit): New implementation in Lisp,
written in terms of process-attributes, and which returns
virtual memory size.
* src/alloc.c (Fmemory_limit): Remove C implementation.
Diffstat (limited to 'src/alloc.c')
| -rw-r--r-- | src/alloc.c | 19 |
1 files changed, 0 insertions, 19 deletions
diff --git a/src/alloc.c b/src/alloc.c index 286358662b9..cc846fd38ee 100644 --- a/src/alloc.c +++ b/src/alloc.c | |||
| @@ -7120,24 +7120,6 @@ or memory information can't be obtained, return nil. */) | |||
| 7120 | 7120 | ||
| 7121 | /* Debugging aids. */ | 7121 | /* Debugging aids. */ |
| 7122 | 7122 | ||
| 7123 | DEFUN ("memory-limit", Fmemory_limit, Smemory_limit, 0, 0, 0, | ||
| 7124 | doc: /* Return the address of the last byte Emacs has allocated, divided by 1024. | ||
| 7125 | This may be helpful in debugging Emacs's memory usage. | ||
| 7126 | We divide the value by 1024 to make sure it fits in a Lisp integer. */) | ||
| 7127 | (void) | ||
| 7128 | { | ||
| 7129 | Lisp_Object end; | ||
| 7130 | |||
| 7131 | #if defined HAVE_NS || defined __APPLE__ || !HAVE_SBRK | ||
| 7132 | /* Avoid warning. sbrk has no relation to memory allocated anyway. */ | ||
| 7133 | XSETINT (end, 0); | ||
| 7134 | #else | ||
| 7135 | XSETINT (end, (intptr_t) (char *) sbrk (0) / 1024); | ||
| 7136 | #endif | ||
| 7137 | |||
| 7138 | return end; | ||
| 7139 | } | ||
| 7140 | |||
| 7141 | DEFUN ("memory-use-counts", Fmemory_use_counts, Smemory_use_counts, 0, 0, 0, | 7123 | DEFUN ("memory-use-counts", Fmemory_use_counts, Smemory_use_counts, 0, 0, 0, |
| 7142 | doc: /* Return a list of counters that measure how much consing there has been. | 7124 | doc: /* Return a list of counters that measure how much consing there has been. |
| 7143 | Each of these counters increments for a certain kind of object. | 7125 | Each of these counters increments for a certain kind of object. |
| @@ -7495,7 +7477,6 @@ The time is in seconds as a floating point value. */); | |||
| 7495 | defsubr (&Smake_finalizer); | 7477 | defsubr (&Smake_finalizer); |
| 7496 | defsubr (&Spurecopy); | 7478 | defsubr (&Spurecopy); |
| 7497 | defsubr (&Sgarbage_collect); | 7479 | defsubr (&Sgarbage_collect); |
| 7498 | defsubr (&Smemory_limit); | ||
| 7499 | defsubr (&Smemory_info); | 7480 | defsubr (&Smemory_info); |
| 7500 | defsubr (&Smemory_use_counts); | 7481 | defsubr (&Smemory_use_counts); |
| 7501 | defsubr (&Ssuspicious_object); | 7482 | defsubr (&Ssuspicious_object); |