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/xselect.c | |
parent | 259a643d7f7c56976ff794cbdba8f5c70c795091 (diff) | |
download | emacs-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/xselect.c')
-rw-r--r-- | src/xselect.c | 17 |
1 files changed, 3 insertions, 14 deletions
diff --git a/src/xselect.c b/src/xselect.c index 3e5778de17e..94a5584214f 100644 --- a/src/xselect.c +++ b/src/xselect.c @@ -384,8 +384,6 @@ x_get_local_selection (Lisp_Object selection_symbol, Lisp_Object target_type, CHECK_SYMBOL (target_type); handler_fn = Fcdr (Fassq (target_type, Vselection_converter_alist)); - /* gcpro is not needed here since nothing but HANDLER_FN - is live, and that ought to be a symbol. */ if (!NILP (handler_fn)) value = call3 (handler_fn, @@ -753,7 +751,6 @@ x_reply_selection_request (struct selection_input_event *event, static void x_handle_selection_request (struct selection_input_event *event) { - struct gcpro gcpro1, gcpro2; Time local_selection_time; struct x_display_info *dpyinfo = SELECTION_EVENT_DPYINFO (event); @@ -765,7 +762,6 @@ x_handle_selection_request (struct selection_input_event *event) Lisp_Object local_selection_data; bool success = false; ptrdiff_t count = SPECPDL_INDEX (); - GCPRO2 (local_selection_data, target_symbol); if (!dpyinfo) goto DONE; @@ -849,7 +845,6 @@ x_handle_selection_request (struct selection_input_event *event) selection_symbol, target_symbol, success ? Qt : Qnil); unbind_to (count, Qnil); - UNGCPRO; } /* Perform the requested selection conversion, and write the data to @@ -864,10 +859,8 @@ x_convert_selection (Lisp_Object selection_symbol, Lisp_Object target_symbol, Atom property, bool for_multiple, struct x_display_info *dpyinfo) { - struct gcpro gcpro1; Lisp_Object lisp_selection; struct selection_data *cs; - GCPRO1 (lisp_selection); lisp_selection = x_get_local_selection (selection_symbol, target_symbol, @@ -891,7 +884,6 @@ x_convert_selection (Lisp_Object selection_symbol, converted_selections = cs; } - UNGCPRO; return false; } @@ -904,7 +896,6 @@ x_convert_selection (Lisp_Object selection_symbol, cs->next = converted_selections; converted_selections = cs; lisp_data_to_selection_data (dpyinfo, lisp_selection, cs); - UNGCPRO; return true; } @@ -1968,9 +1959,7 @@ On Nextstep, TIME-STAMP and TERMINAL are unused. */) Lisp_Object time_stamp, Lisp_Object terminal) { Lisp_Object val = Qnil; - struct gcpro gcpro1, gcpro2; struct frame *f = frame_for_x_selection (terminal); - GCPRO2 (target_type, val); /* we store newly consed data into these */ CHECK_SYMBOL (selection_symbol); CHECK_SYMBOL (target_type); @@ -1986,8 +1975,8 @@ On Nextstep, TIME-STAMP and TERMINAL are unused. */) { Lisp_Object frame; XSETFRAME (frame, f); - RETURN_UNGCPRO (x_get_foreign_selection (selection_symbol, target_type, - time_stamp, frame)); + return x_get_foreign_selection (selection_symbol, target_type, + time_stamp, frame); } if (CONSP (val) && SYMBOLP (XCAR (val))) @@ -1996,7 +1985,7 @@ On Nextstep, TIME-STAMP and TERMINAL are unused. */) if (CONSP (val) && NILP (XCDR (val))) val = XCAR (val); } - RETURN_UNGCPRO (clean_local_selection_data (val)); + return clean_local_selection_data (val); } DEFUN ("x-disown-selection-internal", Fx_disown_selection_internal, |