diff src/lisp.h @ 3988:1227374e7199

[xemacs-hg @ 2007-05-26 18:28:19 by aidan] Make double-free checks 64-bit safe, from Sebastian Freundt.
author aidan
date Sat, 26 May 2007 18:28:23 +0000
parents 98af8a976fc3
children 1abf84db2c7f
line wrap: on
line diff
--- a/src/lisp.h	Fri May 25 21:51:11 2007 +0000
+++ b/src/lisp.h	Sat May 26 18:28:23 2007 +0000
@@ -250,6 +250,14 @@
 typedef unsigned long uintptr_t;
 #endif
 
+#if SIZEOF_VOID_P == 8
+#define DEADBEEF_CONSTANT 0xCAFEBABEDEADBEEF
+#elif SIZEOF_VOID_P == 4
+#define DEADBEEF_CONSTANT 0xDEADBEEF
+#else
+#error "What size are your pointers, really?"
+#endif /* SIZEOF_VOID_P == 8 */
+
 /* ---------------------- definition of EMACS_INT --------------------- */
 
 /* EMACS_INT is the underlying integral type into which a Lisp_Object must fit.
@@ -1084,7 +1092,7 @@
 #define xfree(lvalue, type) do						\
 {									\
   xfree_1 (lvalue);							\
-  VOIDP_CAST (lvalue) = (void *) 0xDEADBEEF;				\
+  VOIDP_CAST (lvalue) = (void *) DEADBEEF_CONSTANT;                     \
 } while (0)
 #else
 #define xfree(lvalue,type) xfree_1 (lvalue)