diff options
| author | Paul Eggert | 2015-10-10 00:17:11 -0700 |
|---|---|---|
| committer | Paul Eggert | 2015-10-10 00:18:39 -0700 |
| commit | bb7c182fdaf8553ffdc9162f322177ae2f7fa0c2 (patch) | |
| tree | 444b1eef3d424cb5b07396a11bc66fe401d0a1dd /src/data.c | |
| parent | 1196e3fca6f9df107c76438b7d00090d19b13570 (diff) | |
| download | emacs-bb7c182fdaf8553ffdc9162f322177ae2f7fa0c2.tar.gz emacs-bb7c182fdaf8553ffdc9162f322177ae2f7fa0c2.zip | |
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.
Diffstat (limited to 'src/data.c')
| -rw-r--r-- | src/data.c | 6 |
1 files changed, 3 insertions, 3 deletions
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, | |||
| 560 | (register Lisp_Object cell, Lisp_Object newcar) | 560 | (register Lisp_Object cell, Lisp_Object newcar) |
| 561 | { | 561 | { |
| 562 | CHECK_CONS (cell); | 562 | CHECK_CONS (cell); |
| 563 | CHECK_IMPURE (cell); | 563 | CHECK_IMPURE (cell, XCONS (cell)); |
| 564 | XSETCAR (cell, newcar); | 564 | XSETCAR (cell, newcar); |
| 565 | return newcar; | 565 | return newcar; |
| 566 | } | 566 | } |
| @@ -570,7 +570,7 @@ DEFUN ("setcdr", Fsetcdr, Ssetcdr, 2, 2, 0, | |||
| 570 | (register Lisp_Object cell, Lisp_Object newcdr) | 570 | (register Lisp_Object cell, Lisp_Object newcdr) |
| 571 | { | 571 | { |
| 572 | CHECK_CONS (cell); | 572 | CHECK_CONS (cell); |
| 573 | CHECK_IMPURE (cell); | 573 | CHECK_IMPURE (cell, XCONS (cell)); |
| 574 | XSETCDR (cell, newcdr); | 574 | XSETCDR (cell, newcdr); |
| 575 | return newcdr; | 575 | return newcdr; |
| 576 | } | 576 | } |
| @@ -2215,7 +2215,7 @@ bool-vector. IDX starts at 0. */) | |||
| 2215 | CHECK_NUMBER (idx); | 2215 | CHECK_NUMBER (idx); |
| 2216 | idxval = XINT (idx); | 2216 | idxval = XINT (idx); |
| 2217 | CHECK_ARRAY (array, Qarrayp); | 2217 | CHECK_ARRAY (array, Qarrayp); |
| 2218 | CHECK_IMPURE (array); | 2218 | CHECK_IMPURE (array, XVECTOR (array)); |
| 2219 | 2219 | ||
| 2220 | if (VECTORP (array)) | 2220 | if (VECTORP (array)) |
| 2221 | { | 2221 | { |