summaryrefslogtreecommitdiff
path: root/src/gmalloc.c
diff options
context:
space:
mode:
authorPaul Eggert <eggert@cs.ucla.edu>2020-08-04 11:09:55 -0700
committerPaul Eggert <eggert@cs.ucla.edu>2020-08-04 11:15:16 -0700
commitfe2649528b0b7637e6b6851c41e696a1016d8d53 (patch)
treeca715aed4e63097fecb6de8f4f6d2b8fc32c1840 /src/gmalloc.c
parent1308587c25cc28248c3d38748f76bb9e6324b929 (diff)
downloademacs-fe2649528b0b7637e6b6851c41e696a1016d8d53.tar.gz
Drop support for -fcheck-pointer-bounds
GCC has removed the -fcheck-pointer bounds option, and the Linux kernel has also removed support for Intel MPX, so there’s no point to keeping this debugging option within Emacs. * src/bytecode.c (BYTE_CODE_THREADED): * src/lisp.h (DEFINE_LISP_SYMBOL, XSYMBOL, make_lisp_symbol): Assume __CHKP__ is not defined. * src/ptr-bounds.h: Remove. All uses of ptr_bounds_clip, ptr_bounds_copy, ptr_bounds_init, ptr_bounds_set removed.
Diffstat (limited to 'src/gmalloc.c')
-rw-r--r--src/gmalloc.c16
1 files changed, 4 insertions, 12 deletions
diff --git a/src/gmalloc.c b/src/gmalloc.c
index 8450a639e77..3560c744539 100644
--- a/src/gmalloc.c
+++ b/src/gmalloc.c
@@ -38,8 +38,6 @@ License along with this library. If not, see <https://www.gnu.org/licenses/>.
#include "lisp.h"
-#include "ptr-bounds.h"
-
#ifdef HAVE_MALLOC_H
# if GNUC_PREREQ (4, 2, 0)
# pragma GCC diagnostic ignored "-Wdeprecated-declarations"
@@ -200,8 +198,7 @@ extern size_t _bytes_free;
/* Internal versions of `malloc', `realloc', and `free'
used when these functions need to call each other.
- They are the same but don't call the hooks
- and don't bound the resulting pointers. */
+ They are the same but don't call the hooks. */
extern void *_malloc_internal (size_t);
extern void *_realloc_internal (void *, size_t);
extern void _free_internal (void *);
@@ -551,7 +548,7 @@ malloc_initialize_1 (void)
_heapinfo[0].free.size = 0;
_heapinfo[0].free.next = _heapinfo[0].free.prev = 0;
_heapindex = 0;
- _heapbase = (char *) ptr_bounds_init (_heapinfo);
+ _heapbase = (char *) _heapinfo;
_heaplimit = BLOCK (_heapbase + heapsize * sizeof (malloc_info));
register_heapinfo ();
@@ -912,8 +909,7 @@ malloc (size_t size)
among multiple threads. We just leave it for compatibility with
glibc malloc (i.e., assignments to gmalloc_hook) for now. */
hook = gmalloc_hook;
- void *result = (hook ? hook : _malloc_internal) (size);
- return ptr_bounds_clip (result, size);
+ return (hook ? hook : _malloc_internal) (size);
}
#if !(defined (_LIBC) || defined (HYBRID_MALLOC))
@@ -991,7 +987,6 @@ _free_internal_nolock (void *ptr)
if (ptr == NULL)
return;
- ptr = ptr_bounds_init (ptr);
PROTECT_MALLOC_STATE (0);
@@ -1303,7 +1298,6 @@ _realloc_internal_nolock (void *ptr, size_t size)
else if (ptr == NULL)
return _malloc_internal_nolock (size);
- ptr = ptr_bounds_init (ptr);
block = BLOCK (ptr);
PROTECT_MALLOC_STATE (0);
@@ -1426,8 +1420,7 @@ realloc (void *ptr, size_t size)
return NULL;
hook = grealloc_hook;
- void *result = (hook ? hook : _realloc_internal) (ptr, size);
- return ptr_bounds_clip (result, size);
+ return (hook ? hook : _realloc_internal) (ptr, size);
}
/* Copyright (C) 1991, 1992, 1994 Free Software Foundation, Inc.
@@ -1601,7 +1594,6 @@ aligned_alloc (size_t alignment, size_t size)
{
l->exact = result;
result = l->aligned = (char *) result + adj;
- result = ptr_bounds_clip (result, size);
}
UNLOCK_ALIGNED_BLOCKS ();
if (l == NULL)