diff --git a/libguile/gc-card.c b/libguile/gc-card.c index 2a22fc544..d1e08f336 100644 --- a/libguile/gc-card.c +++ b/libguile/gc-card.c @@ -58,14 +58,14 @@ SCM scm_i_structs_to_free; we do not actually free the cell. To make the numbers match up, we do increase the FREE_COUNT. - It would be cleaner to have a separate function sweep_value(), but + It would be cleaner to have a separate function sweep_value (), but that is too slow (functions with switch statements can't be inlined). NOTE: For many types of cells, allocation and a de-allocation involves - calling malloc() and free(). This is costly for small objects (due + calling malloc () and free (). This is costly for small objects (due to malloc/free overhead.) (should measure this). It might also be bad for threads: if several threads are allocating @@ -81,7 +81,7 @@ int scm_i_sweep_card (scm_t_cell *card, SCM *free_list, scm_t_heap_segment *seg) #define FUNC_NAME "sweep_card" { - scm_t_c_bvec_long *bitvec = SCM_GC_CARD_BVEC(card); + scm_t_c_bvec_long *bitvec = SCM_GC_CARD_BVEC (card); scm_t_cell *end = card + SCM_GC_CARD_N_CELLS; scm_t_cell *p = card; int span = seg->span; @@ -175,7 +175,7 @@ scm_i_sweep_card (scm_t_cell *card, SCM *free_list, scm_t_heap_segment *seg) if (!(k < scm_numptob)) { fprintf (stderr, "undefined port type"); - abort(); + abort (); } #endif /* Keep "revealed" ports alive. */ @@ -220,7 +220,7 @@ scm_i_sweep_card (scm_t_cell *card, SCM *free_list, scm_t_heap_segment *seg) if (!(k < scm_numsmob)) { fprintf (stderr, "undefined smob type"); - abort(); + abort (); } #endif if (scm_smobs[k].free) @@ -238,7 +238,7 @@ scm_i_sweep_card (scm_t_cell *card, SCM *free_list, scm_t_heap_segment *seg) SCM_SMOBNAME (k)); scm_i_deprecated_memory_return += mm; #else - abort(); + abort (); #endif } } @@ -248,7 +248,7 @@ scm_i_sweep_card (scm_t_cell *card, SCM *free_list, scm_t_heap_segment *seg) break; default: fprintf (stderr, "unknown type"); - abort(); + abort (); } SCM_GC_SET_CELL_WORD (scmptr, 0, scm_tc_free_cell); @@ -296,7 +296,7 @@ scm_i_init_card_freelist (scm_t_cell *card, SCM *free_list, /* Classic MIT Hack, see e.g. http://www.tekpool.com/?cat=9 */ -int scm_i_uint_bit_count(unsigned int u) +int scm_i_uint_bit_count (unsigned int u) { unsigned int u_count = u - ((u >> 1) & 033333333333) @@ -317,7 +317,7 @@ scm_i_card_marked_count (scm_t_cell *card, int span) int count = 0; while (bvec < bvec_end) { - count += scm_i_uint_bit_count(*bvec); + count += scm_i_uint_bit_count (*bvec); bvec ++; } return count * span; @@ -326,7 +326,7 @@ scm_i_card_marked_count (scm_t_cell *card, int span) void scm_i_card_statistics (scm_t_cell *p, SCM hashtab, scm_t_heap_segment *seg) { - scm_t_c_bvec_long *bitvec = SCM_GC_CARD_BVEC(p); + scm_t_c_bvec_long *bitvec = SCM_GC_CARD_BVEC (p); scm_t_cell * end = p + SCM_GC_CARD_N_CELLS; int span = seg->span; int offset = SCM_MAX (SCM_GC_CARD_N_HEADER_CELLS, span); @@ -436,7 +436,7 @@ scm_i_tag_name (scm_t_bits tag) case scm_tc7_smob: /* scm_tc_free_cell is smob 0, the name field in that scm_smobs[] entry should be ok for our return here */ - return scm_smobs[SCM_TC2SMOBNUM(tag)].name; + return scm_smobs[SCM_TC2SMOBNUM (tag)].name; } return NULL; @@ -468,7 +468,7 @@ int scm_dbg_gc_marked_p (SCM obj) { if (!SCM_IMP (obj)) - return SCM_GC_MARK_P(obj); + return SCM_GC_MARK_P (obj); else return 0; } @@ -477,7 +477,7 @@ scm_t_cell * scm_dbg_gc_get_card (SCM obj) { if (!SCM_IMP (obj)) - return SCM_GC_CELL_CARD(obj); + return SCM_GC_CELL_CARD (obj); else return NULL; } diff --git a/libguile/gc-freelist.c b/libguile/gc-freelist.c index 491512055..861af5765 100644 --- a/libguile/gc-freelist.c +++ b/libguile/gc-freelist.c @@ -129,15 +129,15 @@ scm_gc_init_freelist (void) if (scm_i_get_new_heap_segment (&scm_i_master_freelist, init_heap_size_1, return_on_error) == -1) { fprintf (stderr, error_message, init_heap_size_1, 1); - abort(); + abort (); } if (scm_i_get_new_heap_segment (&scm_i_master_freelist2, init_heap_size_2, return_on_error) == -1) { fprintf (stderr, error_message, init_heap_size_2, 2); - abort(); + abort (); } - check_deprecated_heap_vars(); + check_deprecated_heap_vars (); } @@ -178,9 +178,9 @@ scm_i_gc_heap_size_delta (scm_t_cell_type_statistics * freelist) float swept = freelist->swept; float delta = ((f * swept - collected) / (1.0 - f)); - assert(freelist->heap_total_cells >= freelist->collected); - assert(freelist->swept == freelist->heap_total_cells); - assert(swept >= collected); + assert (freelist->heap_total_cells >= freelist->collected); + assert (freelist->swept == freelist->heap_total_cells); + assert (swept >= collected); return delta; } diff --git a/libguile/gc-malloc.c b/libguile/gc-malloc.c index 4e06f2f69..2f6ea21d8 100644 --- a/libguile/gc-malloc.c +++ b/libguile/gc-malloc.c @@ -119,7 +119,7 @@ scm_realloc (void *mem, size_t size) We don't want these sweep statistics to influence results for cell GC, so we don't collect statistics. - realloc() failed, so we're really desparate to free memory. Run a + realloc () failed, so we're really desparate to free memory. Run a full sweep. */ scm_i_sweep_all_segments ("realloc", NULL); @@ -314,7 +314,7 @@ scm_gc_malloc (size_t size, const char *what) again in scm_gc_register_collectable_memory. We don't really want the second GC since it will not find new garbage. - Note: this is a theoretical peeve. In reality, malloc() never + Note: this is a theoretical peeve. In reality, malloc () never returns NULL. Usually, memory is overcommitted, and when you try to write it the program is killed with signal 11. --hwn */ @@ -342,10 +342,10 @@ scm_gc_realloc (void *mem, size_t old_size, size_t new_size, const char *what) /* - scm_realloc() may invalidate the block pointed to by WHERE, eg. by + scm_realloc () may invalidate the block pointed to by WHERE, eg. by unmapping it from memory or altering the contents. Since - increase_mtrigger() might trigger a GC that would scan - MEM, it is crucial that this call precedes realloc(). + increase_mtrigger () might trigger a GC that would scan + MEM, it is crucial that this call precedes realloc (). */ decrease_mtrigger (old_size, what); diff --git a/libguile/gc-mark.c b/libguile/gc-mark.c index 50cd844c9..d72caf1ac 100644 --- a/libguile/gc-mark.c +++ b/libguile/gc-mark.c @@ -339,10 +339,10 @@ scm_gc_mark_dependencies (SCM p) if (!(i < scm_numptob)) { fprintf (stderr, "undefined port type"); - abort(); + abort (); } #endif - if (SCM_PTAB_ENTRY(ptr)) + if (SCM_PTAB_ENTRY (ptr)) scm_gc_mark (SCM_FILENAME (ptr)); if (scm_ptobs[i].mark) { @@ -366,7 +366,7 @@ scm_gc_mark_dependencies (SCM p) if (!(i < scm_numsmob)) { fprintf (stderr, "undefined smob type"); - abort(); + abort (); } #endif if (scm_smobs[i].mark) @@ -380,7 +380,7 @@ scm_gc_mark_dependencies (SCM p) break; default: fprintf (stderr, "unknown type"); - abort(); + abort (); } /* @@ -411,7 +411,7 @@ scm_gc_mark_dependencies (SCM p) if (!valid_cell) { fprintf (stderr, "rogue pointer in heap"); - abort(); + abort (); } } @@ -503,7 +503,7 @@ scm_deprecated_newcell2 (void) void -scm_gc_init_mark(void) +scm_gc_init_mark (void) { #if SCM_ENABLE_DEPRECATED == 1 scm_tc16_allocated = scm_make_smob_type ("allocated cell", 0); diff --git a/libguile/gc-segment-table.c b/libguile/gc-segment-table.c index 4b809ae4b..d0d70fdad 100644 --- a/libguile/gc-segment-table.c +++ b/libguile/gc-segment-table.c @@ -53,7 +53,7 @@ int scm_i_insert_segment (scm_t_heap_segment *seg) { size_t size = (scm_i_heap_segment_table_size + 1) * sizeof (scm_t_heap_segment *); - SCM_SYSCALL(scm_i_heap_segment_table + SCM_SYSCALL (scm_i_heap_segment_table = ((scm_t_heap_segment **) realloc ((char *)scm_i_heap_segment_table, size))); @@ -256,13 +256,13 @@ scm_i_all_segments_statistics (SCM tab) unsigned long* -scm_i_segment_table_info(int* size) +scm_i_segment_table_info (int* size) { *size = scm_i_heap_segment_table_size; unsigned long *bounds = malloc (sizeof (unsigned long) * *size * 2); int i; if (!bounds) - abort(); + abort (); for (i = *size; i-- > 0; ) { bounds[2*i] = (unsigned long)scm_i_heap_segment_table[i]->bounds[0]; diff --git a/libguile/gc-segment.c b/libguile/gc-segment.c index 0668d1561..921459fca 100644 --- a/libguile/gc-segment.c +++ b/libguile/gc-segment.c @@ -108,7 +108,7 @@ scm_i_heap_segment_marked_count (scm_t_heap_segment *seg) int count = 0; while (bvec < bvec_end) { - count += scm_i_uint_bit_count(*bvec); + count += scm_i_uint_bit_count (*bvec); bvec ++; } return count * seg->span; diff --git a/libguile/gc.c b/libguile/gc.c index ce3cb54f8..a293400fa 100644 --- a/libguile/gc.c +++ b/libguile/gc.c @@ -387,7 +387,7 @@ SCM_DEFINE (scm_gc_stats, "gc-stats", 0, 0, 0, scm_cons (sym_cells_swept, scm_from_double (local_scm_gc_cells_swept)), scm_cons (sym_malloc_yield, - scm_from_long(local_scm_gc_malloc_yield_percentage)), + scm_from_long (local_scm_gc_malloc_yield_percentage)), scm_cons (sym_cell_yield, scm_from_long (local_scm_gc_cell_yield_percentage)), scm_cons (sym_protected_objects, @@ -538,7 +538,7 @@ scm_t_c_hook scm_after_sweep_c_hook; scm_t_c_hook scm_after_gc_c_hook; static void -scm_check_deprecated_memory_return() +scm_check_deprecated_memory_return () { if (scm_mallocated < scm_i_deprecated_memory_return) { @@ -584,7 +584,7 @@ scm_i_gc (const char *what) scm_gc_malloc_collected = 0; /* - Set freelists to NULL so scm_cons() always triggers gc, causing + Set freelists to NULL so scm_cons () always triggers gc, causing the assertion above to fail. */ *SCM_FREELIST_LOC (scm_i_freelist) = SCM_EOL; @@ -595,7 +595,7 @@ scm_i_gc (const char *what) garbage, and marking that would create a mess. */ scm_i_sweep_all_segments ("GC", &scm_i_gc_sweep_stats); - scm_check_deprecated_memory_return(); + scm_check_deprecated_memory_return (); /* Sanity check our numbers. */ @@ -670,7 +670,7 @@ scm_i_gc (const char *what) scm_i_thread_wake_up (); /* For debugging purposes, you could do - scm_i_sweep_all_segments("debug"), but then the remains of the + scm_i_sweep_all_segments ("debug"), but then the remains of the cell aren't left to analyse. */ } @@ -774,7 +774,7 @@ scm_permanent_object (SCM obj) */ /* Implementation note: For every object X, there is a counter which - scm_gc_protect_object(X) increments and scm_gc_unprotect_object(X) decrements. + scm_gc_protect_object (X) increments and scm_gc_unprotect_object (X) decrements. */ @@ -949,7 +949,7 @@ scm_init_storage () while (j) scm_sys_protects[--j] = SCM_BOOL_F; - scm_gc_init_freelist(); + scm_gc_init_freelist (); scm_gc_init_malloc (); #if 0 @@ -1071,7 +1071,7 @@ void * scm_ia64_ar_bsp (const void *ctx) { uint64_t bsp; - __uc_get_ar_bsp(ctx, &bsp); + __uc_get_ar_bsp (ctx, &bsp); return (void *) bsp; } # endif /* hpux */