diff options
| author | Paul Eggert | 2011-11-19 19:19:22 -0800 |
|---|---|---|
| committer | Paul Eggert | 2011-11-19 19:19:22 -0800 |
| commit | 17e845af732cf7bd0ada49375f014e10deb3d06a (patch) | |
| tree | dc030088b9f8b008e269028267737d6ba62dcc99 /src/alloc.c | |
| parent | e1dbe924b53c541fdf238a5a722b7177d5c8760b (diff) | |
| parent | 615a3b8d0d2c88cd664f1e0beb5a32b5b8e08f90 (diff) | |
| download | emacs-17e845af732cf7bd0ada49375f014e10deb3d06a.tar.gz emacs-17e845af732cf7bd0ada49375f014e10deb3d06a.zip | |
Standardize on VIRT_ADDR_VARIES behavior.
Otherwise, valgrind does not work on some platforms.
Problem reported by Andreas Schwab in
<http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00081.html>.
* puresize.h (pure, PURE_P): Always behave as if VIRT_ADDR_VARIES
is set, removing the need for VIRT_ADDRESS_VARIES.
(PURE_P): Use a more-efficient implementation that needs just one
comparison, not two: on x86-64 with GCC 4.6.2, this cut down the
number of instructions from 6 (xorl, cmpq, jge, xorl, cmpq, setge)
to 4 (xorl, subq, cmpq, setbe).
* alloc.c (pure): Always extern now, since that's the
VIRT_ADDR_VARIES behavior.
(PURE_POINTER_P): Use a single comparison, not two, for
consistency with the new puresize.h.
* lisp.h (PNTR_COMPARISON_TYPE): Remove; no longer needed.
* m/ibms390.h, m/intel386.h, m/template.h, s/cygwin.h, s/hpux10-20.h:
Remove VIRT_ADDR_VARIES no longer needed.
Fixes: debbugs:10042
Diffstat (limited to 'src/alloc.c')
| -rw-r--r-- | src/alloc.c | 8 |
1 files changed, 1 insertions, 7 deletions
diff --git a/src/alloc.c b/src/alloc.c index 5d04bd77872..96d63f53cf9 100644 --- a/src/alloc.c +++ b/src/alloc.c | |||
| @@ -203,9 +203,6 @@ static int malloc_hysteresis; | |||
| 203 | remapping on more recent systems because this is less important | 203 | remapping on more recent systems because this is less important |
| 204 | nowadays than in the days of small memories and timesharing. */ | 204 | nowadays than in the days of small memories and timesharing. */ |
| 205 | 205 | ||
| 206 | #ifndef VIRT_ADDR_VARIES | ||
| 207 | static | ||
| 208 | #endif | ||
| 209 | EMACS_INT pure[(PURESIZE + sizeof (EMACS_INT) - 1) / sizeof (EMACS_INT)] = {1,}; | 206 | EMACS_INT pure[(PURESIZE + sizeof (EMACS_INT) - 1) / sizeof (EMACS_INT)] = {1,}; |
| 210 | #define PUREBEG (char *) pure | 207 | #define PUREBEG (char *) pure |
| 211 | 208 | ||
| @@ -222,10 +219,7 @@ static ptrdiff_t pure_bytes_used_before_overflow; | |||
| 222 | /* Value is non-zero if P points into pure space. */ | 219 | /* Value is non-zero if P points into pure space. */ |
| 223 | 220 | ||
| 224 | #define PURE_POINTER_P(P) \ | 221 | #define PURE_POINTER_P(P) \ |
| 225 | (((PNTR_COMPARISON_TYPE) (P) \ | 222 | ((uintptr_t) (P) - (uintptr_t) purebeg <= pure_size) |
| 226 | < (PNTR_COMPARISON_TYPE) ((char *) purebeg + pure_size)) \ | ||
| 227 | && ((PNTR_COMPARISON_TYPE) (P) \ | ||
| 228 | >= (PNTR_COMPARISON_TYPE) purebeg)) | ||
| 229 | 223 | ||
| 230 | /* Index in pure at which next pure Lisp object will be allocated.. */ | 224 | /* Index in pure at which next pure Lisp object will be allocated.. */ |
| 231 | 225 | ||