summaryrefslogtreecommitdiff
path: root/src/insdel.c
diff options
context:
space:
mode:
authorPaul Eggert <eggert@cs.ucla.edu>2015-08-26 19:24:28 -0700
committerPaul Eggert <eggert@cs.ucla.edu>2015-08-26 19:24:58 -0700
commit60d1b18734fff144f1608da6228d60e4bda7b24c (patch)
tree9b917c91b7de84ba517dba738784e1f1600f9234 /src/insdel.c
parent259a643d7f7c56976ff794cbdba8f5c70c795091 (diff)
downloademacs-60d1b18734fff144f1608da6228d60e4bda7b24c.tar.gz
emacs-60d1b18734fff144f1608da6228d60e4bda7b24c.tar.bz2
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/insdel.c')
-rw-r--r--src/insdel.c19
1 files changed, 0 insertions, 19 deletions
diff --git a/src/insdel.c b/src/insdel.c
index 22c2bcccb82..a977b79bccc 100644
--- a/src/insdel.c
+++ b/src/insdel.c
@@ -892,7 +892,6 @@ insert_from_string_1 (Lisp_Object string, ptrdiff_t pos, ptrdiff_t pos_byte,
ptrdiff_t nchars, ptrdiff_t nbytes,
bool inherit, bool before_markers)
{
- struct gcpro gcpro1;
ptrdiff_t outgoing_nbytes = nbytes;
INTERVAL intervals;
@@ -906,7 +905,6 @@ insert_from_string_1 (Lisp_Object string, ptrdiff_t pos, ptrdiff_t pos_byte,
= count_size_as_multibyte (SDATA (string) + pos_byte,
nbytes);
- GCPRO1 (string);
/* Do this before moving and increasing the gap,
because the before-change hooks might move the gap
or make it smaller. */
@@ -916,7 +914,6 @@ insert_from_string_1 (Lisp_Object string, ptrdiff_t pos, ptrdiff_t pos_byte,
move_gap_both (PT, PT_BYTE);
if (GAP_SIZE < outgoing_nbytes)
make_gap (outgoing_nbytes - GAP_SIZE);
- UNGCPRO;
/* Copy the string text into the buffer, perhaps converting
between single-byte and multibyte. */
@@ -1278,14 +1275,12 @@ replace_range (ptrdiff_t from, ptrdiff_t to, Lisp_Object new,
ptrdiff_t insbytes = SBYTES (new);
ptrdiff_t from_byte, to_byte;
ptrdiff_t nbytes_del, nchars_del;
- struct gcpro gcpro1;
INTERVAL intervals;
ptrdiff_t outgoing_insbytes = insbytes;
Lisp_Object deletion;
check_markers ();
- GCPRO1 (new);
deletion = Qnil;
if (prepare)
@@ -1295,8 +1290,6 @@ replace_range (ptrdiff_t from, ptrdiff_t to, Lisp_Object new,
to = from + range_length;
}
- UNGCPRO;
-
/* Make args be valid. */
if (from < BEGV)
from = BEGV;
@@ -1321,8 +1314,6 @@ replace_range (ptrdiff_t from, ptrdiff_t to, Lisp_Object new,
outgoing_insbytes
= count_size_as_multibyte (SDATA (new), insbytes);
- GCPRO1 (new);
-
/* Make sure the gap is somewhere in or next to what we are deleting. */
if (from > GPT)
gap_right (from, from_byte);
@@ -1424,7 +1415,6 @@ replace_range (ptrdiff_t from, ptrdiff_t to, Lisp_Object new,
MODIFF++;
CHARS_MODIFF = MODIFF;
- UNGCPRO;
signal_after_change (from, nchars_del, GPT - from);
update_compositions (from, GPT, CHECK_BORDER);
@@ -1561,7 +1551,6 @@ del_range_1 (ptrdiff_t from, ptrdiff_t to, bool prepare, bool ret_string)
{
ptrdiff_t from_byte, to_byte;
Lisp_Object deletion;
- struct gcpro gcpro1;
/* Make args be valid */
if (from < BEGV)
@@ -1583,10 +1572,8 @@ del_range_1 (ptrdiff_t from, ptrdiff_t to, bool prepare, bool ret_string)
to_byte = CHAR_TO_BYTE (to);
deletion = del_range_2 (from, from_byte, to, to_byte, ret_string);
- GCPRO1 (deletion);
signal_after_change (from, to - from, 0);
update_compositions (from, from, CHECK_HEAD);
- UNGCPRO;
return deletion;
}
@@ -1806,13 +1793,10 @@ prepare_to_modify_buffer_1 (ptrdiff_t start, ptrdiff_t end,
if (preserve_ptr)
{
Lisp_Object preserve_marker;
- struct gcpro gcpro1;
preserve_marker = Fcopy_marker (make_number (*preserve_ptr), Qnil);
- GCPRO1 (preserve_marker);
verify_interval_modification (current_buffer, start, end);
*preserve_ptr = marker_position (preserve_marker);
unchain_marker (XMARKER (preserve_marker));
- UNGCPRO;
}
else
verify_interval_modification (current_buffer, start, end);
@@ -1970,7 +1954,6 @@ signal_before_change (ptrdiff_t start_int, ptrdiff_t end_int,
Lisp_Object start, end;
Lisp_Object start_marker, end_marker;
Lisp_Object preserve_marker;
- struct gcpro gcpro1, gcpro2, gcpro3;
ptrdiff_t count = SPECPDL_INDEX ();
struct rvoe_arg rvoe_arg;
@@ -1979,7 +1962,6 @@ signal_before_change (ptrdiff_t start_int, ptrdiff_t end_int,
preserve_marker = Qnil;
start_marker = Qnil;
end_marker = Qnil;
- GCPRO3 (preserve_marker, start_marker, end_marker);
specbind (Qinhibit_modification_hooks, Qt);
@@ -2025,7 +2007,6 @@ signal_before_change (ptrdiff_t start_int, ptrdiff_t end_int,
if (! NILP (end_marker))
free_marker (end_marker);
RESTORE_VALUE;
- UNGCPRO;
unbind_to (count, Qnil);
}