comparison src/free-hook.c @ 424:11054d720c21 r21-2-20

Import from CVS: tag r21-2-20
author cvs
date Mon, 13 Aug 2007 11:26:11 +0200
parents 697ef44129c6
children
comparison
equal deleted inserted replaced
423:28d9c139be4c 424:11054d720c21
83 #include <sys/types.h> 83 #include <sys/types.h>
84 84
85 /* System function prototypes don't belong in C source files */ 85 /* System function prototypes don't belong in C source files */
86 /* extern void free (void *); */ 86 /* extern void free (void *); */
87 87
88 struct hash_table *pointer_table; 88 static struct hash_table *pointer_table;
89 89
90 extern void (*__free_hook) (void *); 90 extern void (*__free_hook) (void *);
91 extern void *(*__malloc_hook) (size_t); 91 extern void *(*__malloc_hook) (size_t);
92 92
93 static void *check_malloc (size_t); 93 static void *check_malloc (size_t);
94 94
95 typedef void (*fun_ptr) (); 95 typedef void (*fun_ptr) (void);
96 96
97 /* free_queue is not too useful without backtrace logging */ 97 /* free_queue is not too useful without backtrace logging */
98 #define FREE_QUEUE_LIMIT 1 98 #define FREE_QUEUE_LIMIT 1
99 #define TRACE_LIMIT 20 99 #define TRACE_LIMIT 20
100 100
108 typedef struct { 108 typedef struct {
109 void *address; 109 void *address;
110 unsigned long length; 110 unsigned long length;
111 } free_queue_entry; 111 } free_queue_entry;
112 112
113 free_queue_entry free_queue[FREE_QUEUE_LIMIT]; 113 static free_queue_entry free_queue[FREE_QUEUE_LIMIT];
114 114
115 int current_free; 115 static int current_free;
116 116
117 int strict_free_check; 117 static int strict_free_check;
118 118
119 static void 119 static void
120 check_free (void *ptr) 120 check_free (void *ptr)
121 { 121 {
122 __free_hook = 0; 122 __free_hook = 0;