comparison src/alloc.c @ 65764:375ab086d366

* image.c (slurp_file, xbm_read_bitmap_data): Cast to the correct type. * xterm.c (handle_one_xevent, handle_one_xevent): Likewise. * unexelf.c (fatal): Fix prototype. * term.c (fatal): Implement using varargs. * regex.c (re_char): Move typedef ... * regex.h (re_char): ... here. (re_iswctype, re_wctype, re_set_whitespace_regexp): New prototypes. * emacs.c (malloc_set_state): Fix return type. (endif): Fix type. * lisp.h (fatal): Add argument types. * dispextern.h (fatal): Delete prototype. * systime.h: (make_time): Prototype moved from ... * editfns.c (make_time): ... here. * editfns.c: Move systime.h include after lisp.h. * dired.c: * xsmfns.c: * process.c: Likewise. * alloc.c (old_malloc_hook, old_realloc_hook, old_realloc_hook): Add parameter types. (__malloc_hook, __realloc_hook, __free_hook): Fix prototypes. (emacs_blocked_free): Change definition to match __free_hook. (emacs_blocked_malloc): Change definition to match __malloc_hook. (emacs_blocked_realloc): Change definition to match __realloc_hook.
author Dan Nicolaescu <dann@ics.uci.edu>
date Fri, 30 Sep 2005 22:38:16 +0000
parents 47f158dcf216
children 5159ee08b219
comparison
equal deleted inserted replaced
65763:1a50ac5aaa75 65764:375ab086d366
1159 can use GNU malloc. */ 1159 can use GNU malloc. */
1160 1160
1161 #ifndef SYNC_INPUT 1161 #ifndef SYNC_INPUT
1162 1162
1163 #ifndef DOUG_LEA_MALLOC 1163 #ifndef DOUG_LEA_MALLOC
1164 extern void * (*__malloc_hook) P_ ((size_t)); 1164 extern void * (*__malloc_hook) P_ ((size_t, const void *));
1165 extern void * (*__realloc_hook) P_ ((void *, size_t)); 1165 extern void * (*__realloc_hook) P_ ((void *, size_t, const void *));
1166 extern void (*__free_hook) P_ ((void *)); 1166 extern void (*__free_hook) P_ ((void *, const void *));
1167 /* Else declared in malloc.h, perhaps with an extra arg. */ 1167 /* Else declared in malloc.h, perhaps with an extra arg. */
1168 #endif /* DOUG_LEA_MALLOC */ 1168 #endif /* DOUG_LEA_MALLOC */
1169 static void * (*old_malloc_hook) (); 1169 static void * (*old_malloc_hook) P_ ((size_t, const void *));
1170 static void * (*old_realloc_hook) (); 1170 static void * (*old_realloc_hook) P_ ((void *, size_t, const void*));
1171 static void (*old_free_hook) (); 1171 static void (*old_free_hook) P_ ((void*, const void*));
1172 1172
1173 /* This function is used as the hook for free to call. */ 1173 /* This function is used as the hook for free to call. */
1174 1174
1175 static void 1175 static void
1176 emacs_blocked_free (ptr) 1176 emacs_blocked_free (ptr, ptr2)
1177 void *ptr; 1177 void *ptr;
1178 const void *ptr2;
1178 { 1179 {
1179 BLOCK_INPUT_ALLOC; 1180 BLOCK_INPUT_ALLOC;
1180 1181
1181 #ifdef GC_MALLOC_CHECK 1182 #ifdef GC_MALLOC_CHECK
1182 if (ptr) 1183 if (ptr)
1219 1220
1220 1221
1221 /* This function is the malloc hook that Emacs uses. */ 1222 /* This function is the malloc hook that Emacs uses. */
1222 1223
1223 static void * 1224 static void *
1224 emacs_blocked_malloc (size) 1225 emacs_blocked_malloc (size, ptr)
1225 size_t size; 1226 size_t size;
1227 const void *ptr;
1226 { 1228 {
1227 void *value; 1229 void *value;
1228 1230
1229 BLOCK_INPUT_ALLOC; 1231 BLOCK_INPUT_ALLOC;
1230 __malloc_hook = old_malloc_hook; 1232 __malloc_hook = old_malloc_hook;
1266 1268
1267 1269
1268 /* This function is the realloc hook that Emacs uses. */ 1270 /* This function is the realloc hook that Emacs uses. */
1269 1271
1270 static void * 1272 static void *
1271 emacs_blocked_realloc (ptr, size) 1273 emacs_blocked_realloc (ptr, size, ptr2)
1272 void *ptr; 1274 void *ptr;
1273 size_t size; 1275 size_t size;
1276 const void *ptr2;
1274 { 1277 {
1275 void *value; 1278 void *value;
1276 1279
1277 BLOCK_INPUT_ALLOC; 1280 BLOCK_INPUT_ALLOC;
1278 __realloc_hook = old_realloc_hook; 1281 __realloc_hook = old_realloc_hook;