Mercurial > hg > xemacs-beta
comparison 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 |
comparison
equal
deleted
inserted
replaced
3987:445918763299 | 3988:1227374e7199 |
---|---|
247 #else | 247 #else |
248 /* Just pray. May break, may not. */ | 248 /* Just pray. May break, may not. */ |
249 typedef long intptr_t; | 249 typedef long intptr_t; |
250 typedef unsigned long uintptr_t; | 250 typedef unsigned long uintptr_t; |
251 #endif | 251 #endif |
252 | |
253 #if SIZEOF_VOID_P == 8 | |
254 #define DEADBEEF_CONSTANT 0xCAFEBABEDEADBEEF | |
255 #elif SIZEOF_VOID_P == 4 | |
256 #define DEADBEEF_CONSTANT 0xDEADBEEF | |
257 #else | |
258 #error "What size are your pointers, really?" | |
259 #endif /* SIZEOF_VOID_P == 8 */ | |
252 | 260 |
253 /* ---------------------- definition of EMACS_INT --------------------- */ | 261 /* ---------------------- definition of EMACS_INT --------------------- */ |
254 | 262 |
255 /* EMACS_INT is the underlying integral type into which a Lisp_Object must fit. | 263 /* EMACS_INT is the underlying integral type into which a Lisp_Object must fit. |
256 In particular, it must be large enough to contain a pointer. | 264 In particular, it must be large enough to contain a pointer. |
1082 evaluation and obviated the need for the TYPE argument. But that triggered | 1090 evaluation and obviated the need for the TYPE argument. But that triggered |
1083 complaints under strict aliasing. #### There should be a better way. */ | 1091 complaints under strict aliasing. #### There should be a better way. */ |
1084 #define xfree(lvalue, type) do \ | 1092 #define xfree(lvalue, type) do \ |
1085 { \ | 1093 { \ |
1086 xfree_1 (lvalue); \ | 1094 xfree_1 (lvalue); \ |
1087 VOIDP_CAST (lvalue) = (void *) 0xDEADBEEF; \ | 1095 VOIDP_CAST (lvalue) = (void *) DEADBEEF_CONSTANT; \ |
1088 } while (0) | 1096 } while (0) |
1089 #else | 1097 #else |
1090 #define xfree(lvalue,type) xfree_1 (lvalue) | 1098 #define xfree(lvalue,type) xfree_1 (lvalue) |
1091 #endif /* ERROR_CHECK_MALLOC */ | 1099 #endif /* ERROR_CHECK_MALLOC */ |
1092 | 1100 |