diff options
| author | Richard M. Stallman | 2002-09-01 13:37:41 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 2002-09-01 13:37:41 +0000 |
| commit | 4455ad75c5aba5dc4bae53fe271fea8b391b4a54 (patch) | |
| tree | fc2030ad8084ca8487bfb2fc4b095b80c1bc97b8 /src/alloc.c | |
| parent | e2518d0288468959a4d36612a3c5a9a270202056 (diff) | |
| download | emacs-4455ad75c5aba5dc4bae53fe271fea8b391b4a54.tar.gz emacs-4455ad75c5aba5dc4bae53fe271fea8b391b4a54.zip | |
(display_malloc_warning): Use display-warning.
(malloc_warning_1): Function deleted.
[ALLOC_DEBUG]: #undef INLINE.
Diffstat (limited to 'src/alloc.c')
| -rw-r--r-- | src/alloc.c | 32 |
1 files changed, 10 insertions, 22 deletions
diff --git a/src/alloc.c b/src/alloc.c index 1d7c9044c7c..8a487214479 100644 --- a/src/alloc.c +++ b/src/alloc.c | |||
| @@ -22,6 +22,10 @@ Boston, MA 02111-1307, USA. */ | |||
| 22 | #include <config.h> | 22 | #include <config.h> |
| 23 | #include <stdio.h> | 23 | #include <stdio.h> |
| 24 | 24 | ||
| 25 | #ifdef ALLOC_DEBUG | ||
| 26 | #undef INLINE | ||
| 27 | #endif | ||
| 28 | |||
| 25 | /* Note that this declares bzero on OSF/1. How dumb. */ | 29 | /* Note that this declares bzero on OSF/1. How dumb. */ |
| 26 | 30 | ||
| 27 | #include <signal.h> | 31 | #include <signal.h> |
| @@ -422,23 +426,7 @@ static POINTER_TYPE *pure_alloc P_ ((size_t, int)); | |||
| 422 | Malloc | 426 | Malloc |
| 423 | ************************************************************************/ | 427 | ************************************************************************/ |
| 424 | 428 | ||
| 425 | /* Write STR to Vstandard_output plus some advice on how to free some | 429 | /* Function malloc calls this if it finds we are near exhausting storage. */ |
| 426 | memory. Called when memory gets low. */ | ||
| 427 | |||
| 428 | Lisp_Object | ||
| 429 | malloc_warning_1 (str) | ||
| 430 | Lisp_Object str; | ||
| 431 | { | ||
| 432 | Fprinc (str, Vstandard_output); | ||
| 433 | write_string ("\nKilling some buffers may delay running out of memory.\n", -1); | ||
| 434 | write_string ("However, certainly by the time you receive the 95% warning,\n", -1); | ||
| 435 | write_string ("you should clean up, kill this Emacs, and start a new one.", -1); | ||
| 436 | return Qnil; | ||
| 437 | } | ||
| 438 | |||
| 439 | |||
| 440 | /* Function malloc calls this if it finds we are near exhausting | ||
| 441 | storage. */ | ||
| 442 | 430 | ||
| 443 | void | 431 | void |
| 444 | malloc_warning (str) | 432 | malloc_warning (str) |
| @@ -448,16 +436,16 @@ malloc_warning (str) | |||
| 448 | } | 436 | } |
| 449 | 437 | ||
| 450 | 438 | ||
| 451 | /* Display a malloc warning in buffer *Danger*. */ | 439 | /* Display an already-pending malloc warning. */ |
| 452 | 440 | ||
| 453 | void | 441 | void |
| 454 | display_malloc_warning () | 442 | display_malloc_warning () |
| 455 | { | 443 | { |
| 456 | register Lisp_Object val; | 444 | call3 (intern ("display-warning"), |
| 457 | 445 | intern ("alloc"), | |
| 458 | val = build_string (pending_malloc_warning); | 446 | build_string (pending_malloc_warning), |
| 447 | intern ("emergency")); | ||
| 459 | pending_malloc_warning = 0; | 448 | pending_malloc_warning = 0; |
| 460 | internal_with_output_to_temp_buffer (" *Danger*", malloc_warning_1, val); | ||
| 461 | } | 449 | } |
| 462 | 450 | ||
| 463 | 451 | ||