comparison src/alloc.c @ 1154:3136b3c99ceb

[xemacs-hg @ 2002-12-12 03:20:35 by stephent] GC messages optional <877keg6i2y.fsf@tleepslib.sk.tsukuba.ac.jp>
author stephent
date Thu, 12 Dec 2002 03:20:43 +0000
parents 37bdd24225ef
children e22b0213b713
comparison
equal deleted inserted replaced
1153:32656d8c7b09 1154:3136b3c99ceb
167 #define always_gc 0 167 #define always_gc 0
168 #endif 168 #endif
169 169
170 /* Nonzero during gc */ 170 /* Nonzero during gc */
171 int gc_in_progress; 171 int gc_in_progress;
172
173 /* Nonzero means display messages at beginning and end of GC. */
174
175 int garbage_collection_messages;
172 176
173 /* Number of times GC has happened at this level or below. 177 /* Number of times GC has happened at this level or below.
174 * Level 0 is most volatile, contrary to usual convention. 178 * Level 0 is most volatile, contrary to usual convention.
175 * (Of course, there's only one level at present) */ 179 * (Of course, there's only one level at present) */
176 EMACS_INT gc_generation_number[1]; 180 EMACS_INT gc_generation_number[1];
4300 } 4304 }
4301 4305
4302 /* Don't print messages to the stream device. */ 4306 /* Don't print messages to the stream device. */
4303 if (!cursor_changed && !FRAME_STREAM_P (f)) 4307 if (!cursor_changed && !FRAME_STREAM_P (f))
4304 { 4308 {
4305 Lisp_Object args[2], whole_msg; 4309 if (garbage_collection_messages)
4306 args[0] = (STRINGP (Vgc_message) ? Vgc_message : 4310 {
4307 build_msg_string (gc_default_message)); 4311 Lisp_Object args[2], whole_msg;
4308 args[1] = build_string ("..."); 4312 args[0] = (STRINGP (Vgc_message) ? Vgc_message :
4309 whole_msg = Fconcat (2, args); 4313 build_msg_string (gc_default_message));
4310 echo_area_message (f, (Ibyte *) 0, whole_msg, 0, -1, 4314 args[1] = build_string ("...");
4311 Qgarbage_collecting); 4315 whole_msg = Fconcat (2, args);
4316 echo_area_message (f, (Ibyte *) 0, whole_msg, 0, -1,
4317 Qgarbage_collecting);
4318 }
4312 } 4319 }
4313 } 4320 }
4314 4321
4315 /***** Now we actually start the garbage collection. */ 4322 /***** Now we actually start the garbage collection. */
4316 4323
4461 { 4468 {
4462 /* Show "...done" only if the echo area would otherwise be empty. */ 4469 /* Show "...done" only if the echo area would otherwise be empty. */
4463 if (NILP (clear_echo_area (selected_frame (), 4470 if (NILP (clear_echo_area (selected_frame (),
4464 Qgarbage_collecting, 0))) 4471 Qgarbage_collecting, 0)))
4465 { 4472 {
4466 Lisp_Object args[2], whole_msg; 4473 if (garbage_collection_messages)
4467 args[0] = (STRINGP (Vgc_message) ? Vgc_message : 4474 {
4468 build_msg_string (gc_default_message)); 4475 Lisp_Object args[2], whole_msg;
4469 args[1] = build_msg_string ("... done"); 4476 args[0] = (STRINGP (Vgc_message) ? Vgc_message :
4470 whole_msg = Fconcat (2, args); 4477 build_msg_string (gc_default_message));
4471 echo_area_message (selected_frame (), (Ibyte *) 0, 4478 args[1] = build_msg_string ("... done");
4472 whole_msg, 0, -1, 4479 whole_msg = Fconcat (2, args);
4473 Qgarbage_collecting); 4480 echo_area_message (selected_frame (), (Ibyte *) 0,
4481 whole_msg, 0, -1,
4482 Qgarbage_collecting);
4483 }
4474 } 4484 }
4475 } 4485 }
4476 } 4486 }
4477 4487
4478 /* now stop inhibiting GC */ 4488 /* now stop inhibiting GC */
5074 DEFVAR_BOOL ("purify-flag", &purify_flag /* 5084 DEFVAR_BOOL ("purify-flag", &purify_flag /*
5075 Non-nil means loading Lisp code in order to dump an executable. 5085 Non-nil means loading Lisp code in order to dump an executable.
5076 This means that certain objects should be allocated in readonly space. 5086 This means that certain objects should be allocated in readonly space.
5077 */ ); 5087 */ );
5078 5088
5089 DEFVAR_BOOL ("garbage-collection-messages", &garbage_collection_messages /*
5090 Non-nil means display messages at start and end of garbage collection.
5091 */ );
5092 garbage_collection_messages = 0;
5093
5079 DEFVAR_LISP ("pre-gc-hook", &Vpre_gc_hook /* 5094 DEFVAR_LISP ("pre-gc-hook", &Vpre_gc_hook /*
5080 Function or functions to be run just before each garbage collection. 5095 Function or functions to be run just before each garbage collection.
5081 Interrupts, garbage collection, and errors are inhibited while this hook 5096 Interrupts, garbage collection, and errors are inhibited while this hook
5082 runs, so be extremely careful in what you add here. In particular, avoid 5097 runs, so be extremely careful in what you add here. In particular, avoid
5083 consing, and do not interact with the user. 5098 consing, and do not interact with the user.