aboutsummaryrefslogtreecommitdiffstats
path: root/src/lisp.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/lisp.h')
-rw-r--r--src/lisp.h48
1 files changed, 0 insertions, 48 deletions
diff --git a/src/lisp.h b/src/lisp.h
index 7aba299f162..e9a525a32b5 100644
--- a/src/lisp.h
+++ b/src/lisp.h
@@ -3568,54 +3568,6 @@ extern int initialized;
3568 3568
3569extern int immediate_quit; /* Nonzero means ^G can quit instantly */ 3569extern int immediate_quit; /* Nonzero means ^G can quit instantly */
3570 3570
3571/* Overhead for overrun check in malloc'ed buffers. The check
3572 operates by wrapping a header and trailer around each block.
3573
3574 The header consists of XMALLOC_OVERRUN_CHECK_SIZE fixed bytes
3575 followed by XMALLOC_OVERRUN_SIZE_SIZE bytes containing the original
3576 block size in little-endian order. The trailer consists of
3577 XMALLOC_OVERRUN_CHECK_SIZE fixed bytes.
3578
3579 The header is used to detect whether this block has been allocated
3580 through these functions, as some low-level libc functions may
3581 bypass the malloc hooks. */
3582
3583#ifndef XMALLOC_OVERRUN_CHECK
3584# define XMALLOC_OVERRUN_CHECK_OVERHEAD 0
3585#else
3586
3587# define XMALLOC_OVERRUN_CHECK_SIZE 16
3588# define XMALLOC_OVERRUN_CHECK_OVERHEAD \
3589 (2 * XMALLOC_OVERRUN_CHECK_SIZE + XMALLOC_OVERRUN_SIZE_SIZE)
3590
3591/* Define XMALLOC_OVERRUN_SIZE_SIZE so that (1) it's large enough to
3592 hold a size_t value and (2) the header size is a multiple of the
3593 alignment that Emacs needs for C types and for USE_LSB_TAG. */
3594# define XMALLOC_BASE_ALIGNMENT \
3595 offsetof ( \
3596 struct { \
3597 union { long double d; intmax_t i; void *p; } u; \
3598 char c; \
3599 }, \
3600 c)
3601# ifdef USE_LSB_TAG
3602/* A common multiple of the positive integers A and B. Ideally this
3603 would be the least common multiple, but there's no way to do that
3604 as a constant expression in C, so do the best that we can easily do. */
3605# define COMMON_MULTIPLE(a, b) \
3606 ((a) % (b) == 0 ? (a) : (b) % (a) == 0 ? (b) : (a) * (b))
3607# define XMALLOC_HEADER_ALIGNMENT \
3608 COMMON_MULTIPLE (1 << GCTYPEBITS, XMALLOC_BASE_ALIGNMENT)
3609# else
3610# define XMALLOC_HEADER_ALIGNMENT XMALLOC_BASE_ALIGNMENT
3611# endif
3612# define XMALLOC_OVERRUN_SIZE_SIZE \
3613 (((XMALLOC_OVERRUN_CHECK_SIZE + sizeof (size_t) \
3614 + XMALLOC_HEADER_ALIGNMENT - 1) \
3615 / XMALLOC_HEADER_ALIGNMENT * XMALLOC_HEADER_ALIGNMENT) \
3616 - XMALLOC_OVERRUN_CHECK_SIZE)
3617#endif
3618
3619extern POINTER_TYPE *xmalloc (size_t); 3571extern POINTER_TYPE *xmalloc (size_t);
3620extern POINTER_TYPE *xrealloc (POINTER_TYPE *, size_t); 3572extern POINTER_TYPE *xrealloc (POINTER_TYPE *, size_t);
3621extern void xfree (POINTER_TYPE *); 3573extern void xfree (POINTER_TYPE *);