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/sysdep.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/sysdep.c')
-rw-r--r-- | src/sysdep.c | 20 |
1 files changed, 1 insertions, 19 deletions
diff --git a/src/sysdep.c b/src/sysdep.c index 25f111ad0ed..836cc271b11 100644 --- a/src/sysdep.c +++ b/src/sysdep.c @@ -2719,10 +2719,8 @@ Lisp_Object list_system_processes (void) { Lisp_Object procdir, match, proclist, next; - struct gcpro gcpro1, gcpro2; - register Lisp_Object tail; + Lisp_Object tail; - GCPRO2 (procdir, match); /* For every process on the system, there's a directory in the "/proc" pseudo-directory whose name is the numeric ID of that process. */ @@ -2737,7 +2735,6 @@ list_system_processes (void) next = XCDR (tail); XSETCAR (tail, Fstring_to_number (XCAR (tail), Qnil)); } - UNGCPRO; /* directory_files_internal returns the files in reverse order; undo that. */ @@ -2759,7 +2756,6 @@ list_system_processes (void) struct kinfo_proc *procs; size_t i; - struct gcpro gcpro1; Lisp_Object proclist = Qnil; if (sysctl (mib, 3, NULL, &len, NULL, 0) != 0) @@ -2772,7 +2768,6 @@ list_system_processes (void) return proclist; } - GCPRO1 (proclist); len /= sizeof (struct kinfo_proc); for (i = 0; i < len; i++) { @@ -2782,7 +2777,6 @@ list_system_processes (void) proclist = Fcons (make_fixnum_or_float (procs[i].ki_pid), proclist); #endif } - UNGCPRO; xfree (procs); @@ -2993,7 +2987,6 @@ system_process_attributes (Lisp_Object pid) Lisp_Object attrs = Qnil; Lisp_Object cmd_str, decoded_cmd; ptrdiff_t count; - struct gcpro gcpro1, gcpro2; CHECK_NUMBER_OR_FLOAT (pid); CONS_TO_INTEGER (pid, pid_t, proc_id); @@ -3001,8 +2994,6 @@ system_process_attributes (Lisp_Object pid) if (stat (procfn, &st) < 0) return attrs; - GCPRO2 (attrs, decoded_cmd); - /* euid egid */ uid = st.st_uid; attrs = Fcons (Fcons (Qeuid, make_fixnum_or_float (uid)), attrs); @@ -3191,7 +3182,6 @@ system_process_attributes (Lisp_Object pid) attrs = Fcons (Fcons (Qargs, decoded_cmd), attrs); } - UNGCPRO; return attrs; } @@ -3230,7 +3220,6 @@ system_process_attributes (Lisp_Object pid) gid_t gid; Lisp_Object attrs = Qnil; Lisp_Object decoded_cmd; - struct gcpro gcpro1, gcpro2; ptrdiff_t count; CHECK_NUMBER_OR_FLOAT (pid); @@ -3239,8 +3228,6 @@ system_process_attributes (Lisp_Object pid) if (stat (procfn, &st) < 0) return attrs; - GCPRO2 (attrs, decoded_cmd); - /* euid egid */ uid = st.st_uid; attrs = Fcons (Fcons (Qeuid, make_fixnum_or_float (uid)), attrs); @@ -3333,7 +3320,6 @@ system_process_attributes (Lisp_Object pid) attrs = Fcons (Fcons (Qargs, decoded_cmd), attrs); } unbind_to (count, Qnil); - UNGCPRO; return attrs; } @@ -3369,7 +3355,6 @@ system_process_attributes (Lisp_Object pid) struct kinfo_proc proc; size_t proclen = sizeof proc; - struct gcpro gcpro1, gcpro2; Lisp_Object attrs = Qnil; Lisp_Object decoded_comm; @@ -3380,8 +3365,6 @@ system_process_attributes (Lisp_Object pid) if (sysctl (mib, 4, &proc, &proclen, NULL, 0) != 0) return attrs; - GCPRO2 (attrs, decoded_comm); - attrs = Fcons (Fcons (Qeuid, make_fixnum_or_float (proc.ki_uid)), attrs); block_input (); @@ -3519,7 +3502,6 @@ system_process_attributes (Lisp_Object pid) attrs = Fcons (Fcons (Qargs, decoded_comm), attrs); } - UNGCPRO; return attrs; } |