Mercurial > hg > xemacs-beta
comparison src/lisp.h @ 1726:a8d8f419b459
[xemacs-hg @ 2003-09-30 15:26:34 by james]
Add type information to xfree to avoid alias creation.
author | james |
---|---|
date | Tue, 30 Sep 2003 15:27:01 +0000 |
parents | 9fc738581a9d |
children | 543769b89fed |
comparison
equal
deleted
inserted
replaced
1725:7ff8f4d70aec | 1726:a8d8f419b459 |
---|---|
1221 (sizevar) *= 2; \ | 1221 (sizevar) *= 2; \ |
1222 XREALLOC_ARRAY (basevar, type, (sizevar)); \ | 1222 XREALLOC_ARRAY (basevar, type, (sizevar)); \ |
1223 } \ | 1223 } \ |
1224 } while (0) | 1224 } while (0) |
1225 | 1225 |
1226 MODULE_API void xfree_1 (void *); | |
1226 #ifdef ERROR_CHECK_MALLOC | 1227 #ifdef ERROR_CHECK_MALLOC |
1227 MODULE_API void xfree_1 (void *); | 1228 #define xfree(lvalue,type) do \ |
1228 #define xfree(lvalue) do \ | |
1229 { \ | 1229 { \ |
1230 void **xfree_ptr = (void **) &(lvalue); \ | 1230 xfree_1 (lvalue); \ |
1231 xfree_1 (*xfree_ptr); \ | 1231 lvalue = (type) 0xDEADBEEF; \ |
1232 *xfree_ptr = (void *) 0xDEADBEEF; \ | |
1233 } while (0) | 1232 } while (0) |
1234 #else | 1233 #else |
1235 MODULE_API void xfree (void *); | 1234 #define xfree(lvalue,type) xfree_1 (lvalue) |
1236 #endif /* ERROR_CHECK_MALLOC */ | 1235 #endif /* ERROR_CHECK_MALLOC */ |
1237 | 1236 |
1238 /* ------------------------ dynamic arrays ------------------- */ | 1237 /* ------------------------ dynamic arrays ------------------- */ |
1239 | 1238 |
1240 #ifdef ERROR_CHECK_STRUCTURES | 1239 #ifdef ERROR_CHECK_STRUCTURES |
1433 /* This is shared by process.h, events.h and others in future. | 1432 /* This is shared by process.h, events.h and others in future. |
1434 See events.h for description */ | 1433 See events.h for description */ |
1435 typedef unsigned int USID; | 1434 typedef unsigned int USID; |
1436 typedef int face_index; | 1435 typedef int face_index; |
1437 typedef int glyph_index; | 1436 typedef int glyph_index; |
1438 typedef struct lstream Lstream; /* lstream-impl.h */ | 1437 typedef struct lstream Lstream; /* lstream.h */ |
1439 typedef struct extent *EXTENT; /* extents-impl.h */ | 1438 typedef struct extent *EXTENT; /* extents-impl.h */ |
1440 typedef struct Lisp_Event Lisp_Event; /* "events.h" */ | 1439 typedef struct Lisp_Event Lisp_Event; /* "events.h" */ |
1441 typedef struct Lisp_Face Lisp_Face; /* "faces-impl.h" */ | 1440 typedef struct Lisp_Face Lisp_Face; /* "faces-impl.h" */ |
1442 typedef struct Lisp_Process Lisp_Process; /* "procimpl.h" */ | 1441 typedef struct Lisp_Process Lisp_Process; /* "procimpl.h" */ |
1443 typedef struct Lisp_Color_Instance Lisp_Color_Instance; /* objects-impl.h */ | 1442 typedef struct Lisp_Color_Instance Lisp_Color_Instance; /* objects-impl.h */ |
1444 typedef struct Lisp_Font_Instance Lisp_Font_Instance; /* objects-impl.h */ | 1443 typedef struct Lisp_Font_Instance Lisp_Font_Instance; /* objects-impl.h */ |
1445 typedef struct Lisp_Image_Instance Lisp_Image_Instance; /* glyphs-impl.h */ | 1444 typedef struct Lisp_Image_Instance Lisp_Image_Instance; /* glyphs.h */ |
1446 typedef struct Lisp_Gui_Item Lisp_Gui_Item; | 1445 typedef struct Lisp_Gui_Item Lisp_Gui_Item; |
1447 | 1446 |
1448 /* ------------------------------- */ | 1447 /* ------------------------------- */ |
1449 /* Dynarr typedefs */ | 1448 /* Dynarr typedefs */ |
1450 /* ------------------------------- */ | 1449 /* ------------------------------- */ |