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 /test | |
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 'test')
-rw-r--r-- | test/automated/finalizer-tests.el | 50 | ||||
-rw-r--r-- | test/automated/generator-tests.el | 14 |
2 files changed, 0 insertions, 64 deletions
diff --git a/test/automated/finalizer-tests.el b/test/automated/finalizer-tests.el index 142152e3fb0..218df05e426 100644 --- a/test/automated/finalizer-tests.el +++ b/test/automated/finalizer-tests.el @@ -29,55 +29,5 @@ (require 'ert) (require 'cl-lib) -(ert-deftest finalizer-basic () - "Test that finalizers run at all." - (skip-unless gc-precise) - (let* ((finalized nil) - (finalizer (make-finalizer (lambda () (setf finalized t))))) - (garbage-collect) - (should (equal finalized nil)) - (setf finalizer nil) - (garbage-collect) - (should (equal finalized t)))) - -(ert-deftest finalizer-circular-reference () - "Test references from a callback to a finalizer." - (skip-unless gc-precise) - (let ((finalized nil)) - (let* ((value nil) - (finalizer (make-finalizer (lambda () (setf finalized value))))) - (setf value finalizer) - (setf finalizer nil)) - (garbage-collect) - (should finalized))) - -(ert-deftest finalizer-cross-reference () - "Test that between-finalizer references do not prevent collection." - (skip-unless gc-precise) - (let ((d nil) (fc 0)) - (let* ((f1-data (cons nil nil)) - (f2-data (cons nil nil)) - (f1 (make-finalizer - (lambda () (cl-incf fc) (setf d f1-data)))) - (f2 (make-finalizer - (lambda () (cl-incf fc) (setf d f2-data))))) - (setcar f1-data f2) - (setcar f2-data f1)) - (garbage-collect) - (should (equal fc 2)))) - -(ert-deftest finalizer-error () - "Test that finalizer errors are suppressed" - (skip-unless gc-precise) - (make-finalizer (lambda () (error "ABCDEF"))) - (garbage-collect) - (with-current-buffer "*Messages*" - (save-excursion - (goto-char (point-max)) - (forward-line -1) - (should (equal - (buffer-substring (point) (point-at-eol)) - "finalizer failed: (error \"ABCDEF\")"))))) - (ert-deftest finalizer-object-type () (should (equal (type-of (make-finalizer nil)) 'finalizer))) diff --git a/test/automated/generator-tests.el b/test/automated/generator-tests.el index d9c81b59a23..96a68d1b9c1 100644 --- a/test/automated/generator-tests.el +++ b/test/automated/generator-tests.el @@ -260,20 +260,6 @@ identical output. (iter-close iter) (should (not cps-test-closed-flag))))) -(ert-deftest cps-test-iter-close-finalizer () - (skip-unless gc-precise) - (garbage-collect) - (let ((cps-test-closed-flag nil)) - (let ((iter (funcall - (iter-lambda () - (unwind-protect (iter-yield 1) - (setf cps-test-closed-flag t)))))) - (should (equal (iter-next iter) 1)) - (should (not cps-test-closed-flag)) - (setf iter nil) - (garbage-collect) - (should cps-test-closed-flag)))) - (ert-deftest cps-test-iter-cleanup-once-only () (let* ((nr-unwound 0) (iter |