Mercurial > emacs
comparison src/alloc.c @ 35170:a9b677239421
(Fgarbage_collect): Use a record_unwind_protect to
ensure that pop_message is called.
| author | Gerd Moellmann <gerd@gnu.org> |
|---|---|
| date | Tue, 09 Jan 2001 13:43:43 +0000 |
| parents | a65d8c29442a |
| children | cc2a06489f0d |
comparison
equal
deleted
inserted
replaced
| 35169:9f4a395a24cb | 35170:a9b677239421 |
|---|---|
| 1 /* Storage allocation and gc for GNU Emacs Lisp interpreter. | 1 /* Storage allocation and gc for GNU Emacs Lisp interpreter. |
| 2 Copyright (C) 1985, 86, 88, 93, 94, 95, 97, 98, 1999, 2000 | 2 Copyright (C) 1985, 86, 88, 93, 94, 95, 97, 98, 1999, 2000, 2001 |
| 3 Free Software Foundation, Inc. | 3 Free Software Foundation, Inc. |
| 4 | 4 |
| 5 This file is part of GNU Emacs. | 5 This file is part of GNU Emacs. |
| 6 | 6 |
| 7 GNU Emacs is free software; you can redistribute it and/or modify | 7 GNU Emacs is free software; you can redistribute it and/or modify |
| 3700 register struct backtrace *backlist; | 3700 register struct backtrace *backlist; |
| 3701 char stack_top_variable; | 3701 char stack_top_variable; |
| 3702 register int i; | 3702 register int i; |
| 3703 int message_p; | 3703 int message_p; |
| 3704 Lisp_Object total[8]; | 3704 Lisp_Object total[8]; |
| 3705 int count = BINDING_STACK_SIZE (); | |
| 3705 | 3706 |
| 3706 /* In case user calls debug_print during GC, | 3707 /* In case user calls debug_print during GC, |
| 3707 don't let that cause a recursive GC. */ | 3708 don't let that cause a recursive GC. */ |
| 3708 consing_since_gc = 0; | 3709 consing_since_gc = 0; |
| 3709 | 3710 |
| 3710 /* Save what's currently displayed in the echo area. */ | 3711 /* Save what's currently displayed in the echo area. */ |
| 3711 message_p = push_message (); | 3712 message_p = push_message (); |
| 3713 record_unwind_protect (push_message_unwind, Qnil); | |
| 3712 | 3714 |
| 3713 /* Save a copy of the contents of the stack, for debugging. */ | 3715 /* Save a copy of the contents of the stack, for debugging. */ |
| 3714 #if MAX_SAVE_STACK > 0 | 3716 #if MAX_SAVE_STACK > 0 |
| 3715 if (NILP (Vpurify_flag)) | 3717 if (NILP (Vpurify_flag)) |
| 3716 { | 3718 { |
| 3911 restore_message (); | 3913 restore_message (); |
| 3912 else | 3914 else |
| 3913 message1_nolog ("Garbage collecting...done"); | 3915 message1_nolog ("Garbage collecting...done"); |
| 3914 } | 3916 } |
| 3915 | 3917 |
| 3916 pop_message (); | 3918 unbind_to (count, Qnil); |
| 3917 | 3919 |
| 3918 total[0] = Fcons (make_number (total_conses), | 3920 total[0] = Fcons (make_number (total_conses), |
| 3919 make_number (total_free_conses)); | 3921 make_number (total_free_conses)); |
| 3920 total[1] = Fcons (make_number (total_symbols), | 3922 total[1] = Fcons (make_number (total_symbols), |
| 3921 make_number (total_free_symbols)); | 3923 make_number (total_free_symbols)); |
