From bb7c182fdaf8553ffdc9162f322177ae2f7fa0c2 Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Sat, 10 Oct 2015 00:17:11 -0700 Subject: CHECK_IMPURE and PURE_P speedup * src/intervals.c (create_root_interval): Do CHECK_IMPURE only for strings; not needed for buffers. Prefer ! STRINGP to BUFFERP, for a tad more speed. * src/puresize.h (CHECK_IMPURE, PURE_P): Now inline functions instead of macros. (PURE_P): Don’t use XPNTR; that is now the caller’s responsibility. All callers changed. (CHECK_IMPURE): New argument PTR, to save us the work of running XPNTR. All callers changed. --- src/data.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/data.c') diff --git a/src/data.c b/src/data.c index eda611055d8..5ee40c54040 100644 --- a/src/data.c +++ b/src/data.c @@ -560,7 +560,7 @@ DEFUN ("setcar", Fsetcar, Ssetcar, 2, 2, 0, (register Lisp_Object cell, Lisp_Object newcar) { CHECK_CONS (cell); - CHECK_IMPURE (cell); + CHECK_IMPURE (cell, XCONS (cell)); XSETCAR (cell, newcar); return newcar; } @@ -570,7 +570,7 @@ DEFUN ("setcdr", Fsetcdr, Ssetcdr, 2, 2, 0, (register Lisp_Object cell, Lisp_Object newcdr) { CHECK_CONS (cell); - CHECK_IMPURE (cell); + CHECK_IMPURE (cell, XCONS (cell)); XSETCDR (cell, newcdr); return newcdr; } @@ -2215,7 +2215,7 @@ bool-vector. IDX starts at 0. */) CHECK_NUMBER (idx); idxval = XINT (idx); CHECK_ARRAY (array, Qarrayp); - CHECK_IMPURE (array); + CHECK_IMPURE (array, XVECTOR (array)); if (VECTORP (array)) { -- cgit v1.2.1