From e57446ab7db28aca5599d8a2c62cfc3b4b9bbffa Mon Sep 17 00:00:00 2001 From: Alastair Bridgewater Date: Wed, 24 Apr 2013 13:12:23 -0400 Subject: [PATCH] Add test cases for non-consing WITHOUT-GCING and WITH-PINNED-OBJECTS. * Neither of these two constructs should cons under normal circumstances, but WITH-PINNED-OBJECTS is occasionally broken in this respect on some backends. May as well make it explicit and official. --- tests/dynamic-extent.impure.lisp | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/tests/dynamic-extent.impure.lisp b/tests/dynamic-extent.impure.lisp index 3a227eb..ee1244b 100644 --- a/tests/dynamic-extent.impure.lisp +++ b/tests/dynamic-extent.impure.lisp @@ -633,6 +633,21 @@ (with-test (:name (:no-consing :hash-tables) :fails-on '(and :ppc :sb-thread)) (assert-no-consing (test-hash-table))) +;;; Both with-pinned-objects and without-gcing should not cons + +(defun call-without-gcing (fun) + (sb-sys:without-gcing (funcall fun))) + +(defun call-with-pinned-object (fun obj) + (sb-sys:with-pinned-objects (obj) + (funcall fun obj))) + +(with-test (:name (:no-consing :without-gcing)) + (assert-no-consing (call-without-gcing (lambda ())))) + +(with-test (:name (:no-consing :with-pinned-objects)) + (assert-no-consing (call-with-pinned-object #'identity 42))) + ;;; with-mutex should use DX and not cons (defvar *mutex* (sb-thread::make-mutex :name "mutexlock")) -- 1.7.10.4