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/editfns.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/editfns.c')
-rw-r--r-- | src/editfns.c | 29 |
1 files changed, 1 insertions, 28 deletions
diff --git a/src/editfns.c b/src/editfns.c index 2703a5dbcb9..9db4d9328a0 100644 --- a/src/editfns.c +++ b/src/editfns.c @@ -958,7 +958,6 @@ void save_excursion_restore (Lisp_Object info) { Lisp_Object tem, tem1; - struct gcpro gcpro1; tem = Fmarker_buffer (XSAVE_OBJECT (info, 0)); /* If we're unwinding to top level, saved buffer may be deleted. This @@ -966,8 +965,6 @@ save_excursion_restore (Lisp_Object info) if (NILP (tem)) goto out; - GCPRO1 (info); - Fset_buffer (tem); /* Point marker. */ @@ -988,8 +985,6 @@ save_excursion_restore (Lisp_Object info) && XBUFFER (tem1) == current_buffer))) Fset_window_point (tem, make_number (PT)); - UNGCPRO; - out: free_misc (info); @@ -2482,11 +2477,6 @@ insert1 (Lisp_Object arg) } -/* Callers passing one argument to Finsert need not gcpro the - argument "array", since the only element of the array will - not be used after calling insert or insert_from_string, so - we don't care if it gets trashed. */ - DEFUN ("insert", Finsert, Sinsert, 0, MANY, 0, doc: /* Insert the arguments, either strings or characters, at point. Point and before-insertion markers move forward to end up @@ -3191,10 +3181,7 @@ Both characters must have the same length of multi-byte form. */) { Lisp_Object tem, string; - struct gcpro gcpro1; - tem = BVAR (current_buffer, undo_list); - GCPRO1 (tem); /* Make a multibyte string containing this single character. */ string = make_multibyte_string ((char *) tostr, 1, len); @@ -3213,8 +3200,6 @@ Both characters must have the same length of multi-byte form. */) if (! NILP (noundo)) bset_undo_list (current_buffer, tem); - - UNGCPRO; } else { @@ -3724,13 +3709,10 @@ usage: (message-box FORMAT-STRING &rest ARGS) */) { Lisp_Object val = Fformat_message (nargs, args); Lisp_Object pane, menu; - struct gcpro gcpro1; pane = list1 (Fcons (build_string ("OK"), Qt)); - GCPRO1 (pane); menu = Fcons (val, pane); Fx_popup_dialog (Qt, menu, Qt); - UNGCPRO; return val; } } @@ -3772,7 +3754,6 @@ usage: (propertize STRING &rest PROPERTIES) */) (ptrdiff_t nargs, Lisp_Object *args) { Lisp_Object properties, string; - struct gcpro gcpro1, gcpro2; ptrdiff_t i; /* Number of args must be odd. */ @@ -3780,7 +3761,6 @@ usage: (propertize STRING &rest PROPERTIES) */) error ("Wrong number of arguments"); properties = string = Qnil; - GCPRO2 (properties, string); /* First argument must be a string. */ CHECK_STRING (args[0]); @@ -3792,7 +3772,7 @@ usage: (propertize STRING &rest PROPERTIES) */) Fadd_text_properties (make_number (0), make_number (SCHARS (string)), properties, string); - RETURN_UNGCPRO (string); + return string; } DEFUN ("format", Fformat, Sformat, 1, MANY, 0, @@ -3914,9 +3894,6 @@ styled_format (ptrdiff_t nargs, Lisp_Object *args, bool message) bool_bf intervals : 1; } *info = 0; - /* It should not be necessary to GCPRO ARGS, because - the caller in the interpreter should take care of that. */ - CHECK_STRING (args[0]); format_start = SSDATA (args[0]); formatlen = SBYTES (args[0]); @@ -4552,12 +4529,10 @@ styled_format (ptrdiff_t nargs, Lisp_Object *args, bool message) if (string_intervals (args[0]) || arg_intervals) { Lisp_Object len, new_len, props; - struct gcpro gcpro1; /* Add text properties from the format string. */ len = make_number (SCHARS (args[0])); props = text_property_list (args[0], make_number (0), len, Qnil); - GCPRO1 (props); if (CONSP (props)) { @@ -4646,8 +4621,6 @@ styled_format (ptrdiff_t nargs, Lisp_Object *args, bool message) add_text_properties_from_list (val, props, make_number (info[n].start)); } - - UNGCPRO; } /* If we allocated BUF or INFO with malloc, free it too. */ |