aboutsummaryrefslogtreecommitdiffstats
path: root/src/buffer.c
diff options
context:
space:
mode:
authorPaul Eggert2015-08-26 19:24:28 -0700
committerPaul Eggert2015-08-26 19:24:58 -0700
commit60d1b18734fff144f1608da6228d60e4bda7b24c (patch)
tree9b917c91b7de84ba517dba738784e1f1600f9234 /src/buffer.c
parent259a643d7f7c56976ff794cbdba8f5c70c795091 (diff)
downloademacs-60d1b18734fff144f1608da6228d60e4bda7b24c.tar.gz
emacs-60d1b18734fff144f1608da6228d60e4bda7b24c.zip
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.c28
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. */)
1629 (Lisp_Object buffer_or_name) 1629 (Lisp_Object buffer_or_name)
1630{ 1630{
1631 Lisp_Object buffer; 1631 Lisp_Object buffer;
1632 register struct buffer *b; 1632 struct buffer *b;
1633 register Lisp_Object tem; 1633 Lisp_Object tem;
1634 register struct Lisp_Marker *m; 1634 struct Lisp_Marker *m;
1635 struct gcpro gcpro1;
1636 1635
1637 if (NILP (buffer_or_name)) 1636 if (NILP (buffer_or_name))
1638 buffer = Fcurrent_buffer (); 1637 buffer = Fcurrent_buffer ();
@@ -1665,10 +1664,8 @@ cleaning up all windows currently displaying the buffer to be killed. */)
1665 if (INTERACTIVE && !NILP (BVAR (b, filename)) 1664 if (INTERACTIVE && !NILP (BVAR (b, filename))
1666 && BUF_MODIFF (b) > BUF_SAVE_MODIFF (b)) 1665 && BUF_MODIFF (b) > BUF_SAVE_MODIFF (b))
1667 { 1666 {
1668 GCPRO1 (buffer);
1669 AUTO_STRING (format, "Buffer %s modified; kill anyway? "); 1667 AUTO_STRING (format, "Buffer %s modified; kill anyway? ");
1670 tem = do_yes_or_no_p (CALLN (Fformat, format, BVAR (b, name))); 1668 tem = do_yes_or_no_p (CALLN (Fformat, format, BVAR (b, name)));
1671 UNGCPRO;
1672 if (NILP (tem)) 1669 if (NILP (tem))
1673 return unbind_to (count, Qnil); 1670 return unbind_to (count, Qnil);
1674 } 1671 }
@@ -1702,8 +1699,6 @@ cleaning up all windows currently displaying the buffer to be killed. */)
1702 { 1699 {
1703 struct buffer *other; 1700 struct buffer *other;
1704 1701
1705 GCPRO1 (buffer);
1706
1707 FOR_EACH_BUFFER (other) 1702 FOR_EACH_BUFFER (other)
1708 if (other->base_buffer == b) 1703 if (other->base_buffer == b)
1709 { 1704 {
@@ -1712,8 +1707,6 @@ cleaning up all windows currently displaying the buffer to be killed. */)
1712 Fkill_buffer (buf); 1707 Fkill_buffer (buf);
1713 } 1708 }
1714 1709
1715 UNGCPRO;
1716
1717 /* Exit if we now have killed the base buffer (Bug#11665). */ 1710 /* Exit if we now have killed the base buffer (Bug#11665). */
1718 if (!BUFFER_LIVE_P (b)) 1711 if (!BUFFER_LIVE_P (b))
1719 return Qt; 1712 return Qt;
@@ -1751,9 +1744,7 @@ cleaning up all windows currently displaying the buffer to be killed. */)
1751 /* Unlock this buffer's file, if it is locked. */ 1744 /* Unlock this buffer's file, if it is locked. */
1752 unlock_buffer (b); 1745 unlock_buffer (b);
1753 1746
1754 GCPRO1 (buffer);
1755 kill_buffer_processes (buffer); 1747 kill_buffer_processes (buffer);
1756 UNGCPRO;
1757 1748
1758 /* Killing buffer processes may run sentinels which may have killed 1749 /* Killing buffer processes may run sentinels which may have killed
1759 our buffer. */ 1750 our buffer. */
@@ -2409,7 +2400,6 @@ current buffer is cleared. */)
2409 bool narrowed = (BEG != BEGV || Z != ZV); 2400 bool narrowed = (BEG != BEGV || Z != ZV);
2410 bool modified_p = !NILP (Fbuffer_modified_p (Qnil)); 2401 bool modified_p = !NILP (Fbuffer_modified_p (Qnil));
2411 Lisp_Object old_undo = BVAR (current_buffer, undo_list); 2402 Lisp_Object old_undo = BVAR (current_buffer, undo_list);
2412 struct gcpro gcpro1;
2413 2403
2414 if (current_buffer->base_buffer) 2404 if (current_buffer->base_buffer)
2415 error ("Cannot do `set-buffer-multibyte' on an indirect buffer"); 2405 error ("Cannot do `set-buffer-multibyte' on an indirect buffer");
@@ -2418,8 +2408,6 @@ current buffer is cleared. */)
2418 if (NILP (flag) == NILP (BVAR (current_buffer, enable_multibyte_characters))) 2408 if (NILP (flag) == NILP (BVAR (current_buffer, enable_multibyte_characters)))
2419 return flag; 2409 return flag;
2420 2410
2421 GCPRO1 (old_undo);
2422
2423 /* Don't record these buffer changes. We will put a special undo entry 2411 /* Don't record these buffer changes. We will put a special undo entry
2424 instead. */ 2412 instead. */
2425 bset_undo_list (current_buffer, Qt); 2413 bset_undo_list (current_buffer, Qt);
@@ -2649,8 +2637,6 @@ current buffer is cleared. */)
2649 old_undo)); 2637 old_undo));
2650 } 2638 }
2651 2639
2652 UNGCPRO;
2653
2654 current_buffer->prevent_redisplay_optimizations_p = 1; 2640 current_buffer->prevent_redisplay_optimizations_p = 1;
2655 2641
2656 /* If buffer is shown in a window, let redisplay consider other windows. */ 2642 /* 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,
4394 struct Lisp_Overlay *tail; 4380 struct Lisp_Overlay *tail;
4395 /* True if this change is an insertion. */ 4381 /* True if this change is an insertion. */
4396 bool insertion = (after ? XFASTINT (arg3) == 0 : EQ (start, end)); 4382 bool insertion = (after ? XFASTINT (arg3) == 0 : EQ (start, end));
4397 struct gcpro gcpro1, gcpro2, gcpro3, gcpro4;
4398 4383
4399 overlay = Qnil; 4384 overlay = Qnil;
4400 tail = NULL; 4385 tail = NULL;
@@ -4487,7 +4472,6 @@ report_overlay_modification (Lisp_Object start, Lisp_Object end, bool after,
4487 } 4472 }
4488 } 4473 }
4489 4474
4490 GCPRO4 (overlay, arg1, arg2, arg3);
4491 { 4475 {
4492 /* Call the functions recorded in last_overlay_modification_hooks. 4476 /* Call the functions recorded in last_overlay_modification_hooks.
4493 First copy the vector contents, in case some of these hooks 4477 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,
4511 4495
4512 SAFE_FREE (); 4496 SAFE_FREE ();
4513 } 4497 }
4514 UNGCPRO;
4515} 4498}
4516 4499
4517static void 4500static void
4518call_overlay_mod_hooks (Lisp_Object list, Lisp_Object overlay, bool after, 4501call_overlay_mod_hooks (Lisp_Object list, Lisp_Object overlay, bool after,
4519 Lisp_Object arg1, Lisp_Object arg2, Lisp_Object arg3) 4502 Lisp_Object arg1, Lisp_Object arg2, Lisp_Object arg3)
4520{ 4503{
4521 struct gcpro gcpro1, gcpro2, gcpro3, gcpro4;
4522
4523 GCPRO4 (list, arg1, arg2, arg3);
4524
4525 while (CONSP (list)) 4504 while (CONSP (list))
4526 { 4505 {
4527 if (NILP (arg3)) 4506 if (NILP (arg3))
@@ -4530,7 +4509,6 @@ call_overlay_mod_hooks (Lisp_Object list, Lisp_Object overlay, bool after,
4530 call5 (XCAR (list), overlay, after ? Qt : Qnil, arg1, arg2, arg3); 4509 call5 (XCAR (list), overlay, after ? Qt : Qnil, arg1, arg2, arg3);
4531 list = XCDR (list); 4510 list = XCDR (list);
4532 } 4511 }
4533 UNGCPRO;
4534} 4512}
4535 4513
4536/* Delete any zero-sized overlays at position POS, if the `evaporate' 4514/* Delete any zero-sized overlays at position POS, if the `evaporate'