GC_bool GC_try_to_collect_inner(GC_stop_func stop_func)
{
CLOCK_TYPE start_time = CLOCK_ZERO;
- CLOCK_TYPE current_time;
+ CLOCK_TYPE current_time;
if (GC_dont_gc) return FALSE;
/* PLTSCHEME */
if (GC_collect_start_callback)
unsigned i;
int dummy;
CLOCK_TYPE start_time = CLOCK_ZERO;
- CLOCK_TYPE current_time;
-
+ CLOCK_TYPE current_time;
+
if (GC_print_stats)
- GET_TIME(start_time);
+ GET_TIME(start_time);
# if !defined(REDIRECT_MALLOC) && (defined(MSWIN32) || defined(MSWINCE))
GC_add_current_malloc_heap();
*/
mse * GC_mark_from(mse *mark_stack_top, mse *mark_stack, mse *mark_stack_limit)
{
- signed_word credit = HBLKSIZE; /* Remaining credit for marking work */
- ptr_t current_p; /* Pointer to current candidate ptr. */
- word current; /* Candidate pointer. */
- ptr_t limit = NULL; /* (Incl) limit of current candidate */
- /* range */
+ signed_word credit = HBLKSIZE; /* Remaining credit for marking work */
+ ptr_t current_p; /* Pointer to current candidate ptr. */
+ word current; /* Candidate pointer. */
+ ptr_t limit = NULL; /* (Incl) limit of current candidate */
+ /* range */
word descr;
ptr_t greatest_ha = GC_greatest_plausible_heap_addr;
ptr_t least_ha = GC_least_plausible_heap_addr;
/* If we were more serious about it, these should go inside */
/* the loops. But write prefetches usually don't seem to */
/* matter much. */
- PREFETCH_FOR_WRITE((ptr_t)h);
- PREFETCH_FOR_WRITE((ptr_t)h + 128);
- PREFETCH_FOR_WRITE((ptr_t)h + 256);
- PREFETCH_FOR_WRITE((ptr_t)h + 378);
+ PREFETCH_FOR_WRITE((ptr_t)h);
+ PREFETCH_FOR_WRITE((ptr_t)h + 128);
+ PREFETCH_FOR_WRITE((ptr_t)h + 256);
+ PREFETCH_FOR_WRITE((ptr_t)h + 378);
/* Handle small objects sizes more efficiently. For larger objects */
/* the difference is less significant. */
# ifndef SMALL_CONFIG
- switch (sz) {
- case 2: if (clear) {
- return GC_build_fl_clear2(h, list);
- } else {
- return GC_build_fl2(h, list);
- }
- case 4: if (clear) {
- return GC_build_fl_clear4(h, list);
- } else {
- return GC_build_fl4(h, list);
- }
- default:
- break;
+ switch (sz) {
+ case 2: if (clear) {
+ return GC_build_fl_clear2(h, list);
+ } else {
+ return GC_build_fl2(h, list);
}
+ case 4: if (clear) {
+ return GC_build_fl_clear4(h, list);
+ } else {
+ return GC_build_fl4(h, list);
+ }
+ default:
+ break;
+ }
# endif /* !SMALL_CONFIG */
-
+
/* Clear the page if necessary. */
- if (clear) BZERO(h, HBLKSIZE);
-
+ if (clear) BZERO(h, HBLKSIZE);
+
/* Add objects to free list */
- p = (word *)(h -> hb_body) + sz; /* second object in *h */
- prev = (word *)(h -> hb_body); /* One object behind p */
- last_object = (word *)((char *)h + HBLKSIZE);
- last_object -= sz;
- /* Last place for last object to start */
+ p = (word *)(h -> hb_body) + sz; /* second object in *h */
+ prev = (word *)(h -> hb_body); /* One object behind p */
+ last_object = (word *)((char *)h + HBLKSIZE);
+ last_object -= sz;
+ /* Last place for last object to start */
/* make a list of all objects in *h with head as last object */
- while (p <= last_object) {
- /* current object's link points to last object */
- obj_link(p) = (ptr_t)prev;
- prev = p;
- p += sz;
- }
- p -= sz; /* p now points to last object */
+ while (p <= last_object) {
+ /* current object's link points to last object */
+ obj_link(p) = (ptr_t)prev;
+ prev = p;
+ p += sz;
+ }
+ p -= sz; /* p now points to last object */
/*
* put p (which is now head of list of objects in *h) as first
* pointer in the appropriate free list for this size.
*/
- word *tmp = (word *)h->hb_body;
- obj_link(tmp) = list;
- return ((ptr_t)p);
+ word *tmp = (word *)h->hb_body;
+ obj_link(tmp) = list;
+ return ((ptr_t)p);
}