17 |
|
|
18 |
|
|
19 |
# include "private/gc_priv.h" |
# include "private/gc_priv.h" |
20 |
|
#include <malloc.h> |
21 |
# include <stdio.h> |
# include <stdio.h> |
22 |
# if !defined(MACOS) && !defined(MSWINCE) |
# if !defined(MACOS) && !defined(MSWINCE) |
23 |
# include <signal.h> |
# include <signal.h> |
135 |
} |
} |
136 |
#endif /* !SMALL_CONFIG */ |
#endif /* !SMALL_CONFIG */ |
137 |
|
|
138 |
|
#if 0 |
139 |
|
void* callocx (size_t n, size_t size) |
140 |
|
{ |
141 |
|
void *val; |
142 |
|
mallopt (M_MMAP_MAX, 0); |
143 |
|
val = calloc (n, size); |
144 |
|
mallopt (M_MMAP_MAX, 100000000); |
145 |
|
return val; |
146 |
|
} |
147 |
|
#endif |
148 |
|
|
149 |
/* Return the minimum number of words that must be allocated between */ |
/* Return the minimum number of words that must be allocated between */ |
150 |
/* collections to amortize the collection cost. */ |
/* collections to amortize the collection cost. */ |
151 |
static word min_words_allocd() |
static word min_words_allocd() |
308 |
} |
} |
309 |
|
|
310 |
|
|
311 |
|
void (*GC_collect_start_callback)GC_PROTO((void)) = NULL; |
312 |
|
void (*GC_collect_end_callback)GC_PROTO((void)) = NULL; |
313 |
|
|
314 |
/* |
/* |
315 |
* Stop the world garbage collection. Assumes lock held, signals disabled. |
* Stop the world garbage collection. Assumes lock held, signals disabled. |
316 |
* If stop_func is not GC_never_stop_func, then abort if stop_func returns TRUE. |
* If stop_func is not GC_never_stop_func, then abort if stop_func returns TRUE. |
323 |
CLOCK_TYPE start_time, current_time; |
CLOCK_TYPE start_time, current_time; |
324 |
# endif |
# endif |
325 |
if (GC_dont_gc) return FALSE; |
if (GC_dont_gc) return FALSE; |
326 |
|
if (GC_collect_start_callback) |
327 |
|
GC_collect_start_callback(); |
328 |
if (GC_incremental && GC_collection_in_progress()) { |
if (GC_incremental && GC_collection_in_progress()) { |
329 |
# ifdef CONDPRINT |
# ifdef CONDPRINT |
330 |
if (GC_print_stats) { |
if (GC_print_stats) { |
387 |
MS_TIME_DIFF(current_time,start_time)); |
MS_TIME_DIFF(current_time,start_time)); |
388 |
} |
} |
389 |
# endif |
# endif |
390 |
|
if (GC_collect_end_callback) |
391 |
|
GC_collect_end_callback(); |
392 |
return(TRUE); |
return(TRUE); |
393 |
} |
} |
394 |
|
|