diff options
| author | Paul Eggert <eggert@cs.ucla.edu> | 2015-08-26 19:24:28 -0700 |
|---|---|---|
| committer | Paul Eggert <eggert@cs.ucla.edu> | 2015-08-26 19:24:58 -0700 |
| commit | 60d1b18734fff144f1608da6228d60e4bda7b24c (patch) | |
| tree | 9b917c91b7de84ba517dba738784e1f1600f9234 /src/buffer.c | |
| parent | 259a643d7f7c56976ff794cbdba8f5c70c795091 (diff) | |
| download | emacs-60d1b18734fff144f1608da6228d60e4bda7b24c.tar.gz | |
Assume GC_MARK_STACK == GC_MAKE_GCPROS_NOOPS
This removes the need for GCPRO1 etc. Suggested by Stefan Monnier in:
http://lists.gnu.org/archive/html/emacs-devel/2015-08/msg00918.html
* doc/lispref/internals.texi (Writing Emacs Primitives):
* etc/NEWS:
Document the change.
* src/alloc.c (gcprolist, dump_zombies, MAX_ZOMBIES, zombies)
(nzombies, ngcs, avg_zombies, max_live, max_zombies, avg_live)
(Fgc_status, check_gcpros, relocatable_string_data_p, gc-precise):
* src/bytecode.c (mark_byte_stack) [BYTE_MARK_STACK]:
* src/eval.c (gcpro_level) [DEBUG_GCPRO]:
* src/lisp.h (struct handler.gcpro, struct gcpro, GC_MARK_STACK)
(GC_USE_GCPROS_AS_BEFORE, GC_MAKE_GCPROS_NOOPS)
(GC_MARK_STACK_CHECK_GCPROS, GC_USE_GCPROS_CHECK_ZOMBIES)
(BYTE_MARK_STACK, GCPRO1, GCPRO2, GCPRO3, GCPRO4, GCPRO5, GCPRO6)
(GCPRO7, UNGCPRO, RETURN_UNGCPRO):
Remove. All uses removed. The code now assumes
GC_MARK_STACK == GC_MAKE_GCPROS_NOOPS.
* src/bytecode.c (relocate_byte_stack):
Rename from unmark_byte_stack, since it now only relocates.
All callers changed.
* src/frame.c (make_frame): Add an IF_LINT to pacify GCC 5.2
with GCPROs removed.
* src/systime.h: Use EMACS_LISP_H as the canary instead of GCPRO1.
* test/automated/finalizer-tests.el (finalizer-basic)
(finalizer-circular-reference, finalizer-cross-reference)
(finalizer-error):
* test/automated/generator-tests.el (cps-test-iter-close-finalizer):
Remove tests, as they depend on gc-precise.
Diffstat (limited to 'src/buffer.c')
| -rw-r--r-- | src/buffer.c | 28 |
1 files changed, 3 insertions, 25 deletions
diff --git a/src/buffer.c b/src/buffer.c index fb1502a13a4..fc2ee82e447 100644 --- a/src/buffer.c +++ b/src/buffer.c @@ -1629,10 +1629,9 @@ cleaning up all windows currently displaying the buffer to be killed. */) (Lisp_Object buffer_or_name) { Lisp_Object buffer; - register struct buffer *b; - register Lisp_Object tem; - register struct Lisp_Marker *m; - struct gcpro gcpro1; + struct buffer *b; + Lisp_Object tem; + struct Lisp_Marker *m; if (NILP (buffer_or_name)) buffer = Fcurrent_buffer (); @@ -1665,10 +1664,8 @@ cleaning up all windows currently displaying the buffer to be killed. */) if (INTERACTIVE && !NILP (BVAR (b, filename)) && BUF_MODIFF (b) > BUF_SAVE_MODIFF (b)) { - GCPRO1 (buffer); AUTO_STRING (format, "Buffer %s modified; kill anyway? "); tem = do_yes_or_no_p (CALLN (Fformat, format, BVAR (b, name))); - UNGCPRO; if (NILP (tem)) return unbind_to (count, Qnil); } @@ -1702,8 +1699,6 @@ cleaning up all windows currently displaying the buffer to be killed. */) { struct buffer *other; - GCPRO1 (buffer); - FOR_EACH_BUFFER (other) if (other->base_buffer == b) { @@ -1712,8 +1707,6 @@ cleaning up all windows currently displaying the buffer to be killed. */) Fkill_buffer (buf); } - UNGCPRO; - /* Exit if we now have killed the base buffer (Bug#11665). */ if (!BUFFER_LIVE_P (b)) return Qt; @@ -1751,9 +1744,7 @@ cleaning up all windows currently displaying the buffer to be killed. */) /* Unlock this buffer's file, if it is locked. */ unlock_buffer (b); - GCPRO1 (buffer); kill_buffer_processes (buffer); - UNGCPRO; /* Killing buffer processes may run sentinels which may have killed our buffer. */ @@ -2409,7 +2400,6 @@ current buffer is cleared. */) bool narrowed = (BEG != BEGV || Z != ZV); bool modified_p = !NILP (Fbuffer_modified_p (Qnil)); Lisp_Object old_undo = BVAR (current_buffer, undo_list); - struct gcpro gcpro1; if (current_buffer->base_buffer) error ("Cannot do `set-buffer-multibyte' on an indirect buffer"); @@ -2418,8 +2408,6 @@ current buffer is cleared. */) if (NILP (flag) == NILP (BVAR (current_buffer, enable_multibyte_characters))) return flag; - GCPRO1 (old_undo); - /* Don't record these buffer changes. We will put a special undo entry instead. */ bset_undo_list (current_buffer, Qt); @@ -2649,8 +2637,6 @@ current buffer is cleared. */) old_undo)); } - UNGCPRO; - current_buffer->prevent_redisplay_optimizations_p = 1; /* If buffer is shown in a window, let redisplay consider other windows. */ @@ -4394,7 +4380,6 @@ report_overlay_modification (Lisp_Object start, Lisp_Object end, bool after, struct Lisp_Overlay *tail; /* True if this change is an insertion. */ bool insertion = (after ? XFASTINT (arg3) == 0 : EQ (start, end)); - struct gcpro gcpro1, gcpro2, gcpro3, gcpro4; overlay = Qnil; tail = NULL; @@ -4487,7 +4472,6 @@ report_overlay_modification (Lisp_Object start, Lisp_Object end, bool after, } } - GCPRO4 (overlay, arg1, arg2, arg3); { /* Call the functions recorded in last_overlay_modification_hooks. First copy the vector contents, in case some of these hooks @@ -4511,17 +4495,12 @@ report_overlay_modification (Lisp_Object start, Lisp_Object end, bool after, SAFE_FREE (); } - UNGCPRO; } static void call_overlay_mod_hooks (Lisp_Object list, Lisp_Object overlay, bool after, Lisp_Object arg1, Lisp_Object arg2, Lisp_Object arg3) { - struct gcpro gcpro1, gcpro2, gcpro3, gcpro4; - - GCPRO4 (list, arg1, arg2, arg3); - while (CONSP (list)) { if (NILP (arg3)) @@ -4530,7 +4509,6 @@ call_overlay_mod_hooks (Lisp_Object list, Lisp_Object overlay, bool after, call5 (XCAR (list), overlay, after ? Qt : Qnil, arg1, arg2, arg3); list = XCDR (list); } - UNGCPRO; } /* Delete any zero-sized overlays at position POS, if the `evaporate' |
