aboutsummaryrefslogtreecommitdiffstats
path: root/etc
diff options
context:
space:
mode:
authorPaul Eggert2017-12-09 13:57:38 -0800
committerPaul Eggert2017-12-12 15:17:12 -0800
commit881abfc7fb55db2d00adf352100cc58a6a86c176 (patch)
tree4bb07ccaf020ea861ce95ff4fd57bb6d2c562810 /etc
parent244346c744a6700d320a0a0fe8c796be3b3ff023 (diff)
downloademacs-881abfc7fb55db2d00adf352100cc58a6a86c176.tar.gz
emacs-881abfc7fb55db2d00adf352100cc58a6a86c176.zip
Port to gcc -fcheck-pointer-bounds
This is a minimal port, just to get Emacs running; it does not attempt to make the pointer bounds at all tight. * src/ptr-bounds.h: New file. * src/alloc.c, src/gmalloc.c: Include it. * src/alloc.c (live_string_holding, live_cons_holding) (live_symbol_holding, live_misc_holding, garbage_collect_1) (sweep_conses, sweep_floats): * src/gmalloc.c (malloc_initialize_1, _free_internal_nolock) (_realloc_internal_nolock): Widen pointer bounds as necessary. We're in a memory allocator so this is OK. * src/lisp.h (lisp_h_XSYMBOL, make_lisp_symbol) [__CHKP__]: Do not convert from pointer to integer and back again, so that GCC does not lose track of pointer bounds. (XSYMBOL) [__CHKP__ && !USE_LSB_TAG]: Now a compile-time error. Although it's possible to support both -fcheck-pointer-bounds and --with-wide-int, it's more work; keep things simple for now. (DEFINE_LISP_SYMBOL) [__CHKP__]: Now a no-op, to avoid trouble with unbounded pointers.
Diffstat (limited to 'etc')
-rw-r--r--etc/NEWS7
1 files changed, 7 insertions, 0 deletions
diff --git a/etc/NEWS b/etc/NEWS
index c0d0d42d3f7..7376fc48b31 100644
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -31,6 +31,13 @@ functions 'json-serialize', 'json-insert', 'json-parse-string', and
31'json-parse-buffer' are typically much faster than their Lisp 31'json-parse-buffer' are typically much faster than their Lisp
32counterparts from json.el. 32counterparts from json.el.
33 33
34** Emacs has been ported to the -fcheck-pointer-bounds option of GCC.
35This causes Emacs to check bounds of some arrays addressed by its
36internal pointers, which can be helpful when debugging the Emacs
37interpreter or modules that it uses. If your platform supports it you
38can enable it when configuring, e.g., './configure CFLAGS="-g3 -O2
39-mmpx -fcheck-pointer-bounds"' on Intel MPX platforms.
40
34 41
35* Startup Changes in Emacs 27.1 42* Startup Changes in Emacs 27.1
36 43