From: ivmai Date: Fri, 25 Sep 2009 07:13:13 +0000 (+0000) Subject: 2009-09-25 Ivan Maidanski X-Git-Tag: gc7_2alpha4~99 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=0dbf78a04c14c7a6cfb3302f9faa4b6bcaa44b35;p=gc 2009-09-25 Ivan Maidanski * checksums.c (GC_checksum, GC_update_check_page): Remove "register" keyword in local variable declarations (for the code used only for debugging or which is not time-critical). * dbg_mlc.c (GC_has_other_debug_info, GC_store_debug_info, GC_store_debug_info_inner, GC_check_annotated_obj, GC_print_obj, GC_print_smashed_obj, GC_debug_end_stubborn_change, GC_debug_invoke_finalizer): Ditto. * dyn_load.c (GC_register_dynamic_libraries): Ditto. * mallocx.c (GC_realloc): Ditto. * mark_rts.c (GC_print_static_roots, GC_is_static_root, GC_clear_roots): Ditto. * misc.c (GC_write): Ditto. * os_dep.c (GC_print_callers): Ditto. * dyn_load.c (GC_register_dynamic_libraries): Rename "i" local variable to "j" for the nested loop (just not to hide the similar variable in the outer one). * mark_rts.c (GC_print_static_roots): Output an error message using GC_err_printf() (instead of GC_printf()). --- diff --git a/ChangeLog b/ChangeLog index adf37627..71f05fd4 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,24 @@ +2009-09-25 Ivan Maidanski + + * checksums.c (GC_checksum, GC_update_check_page): Remove + "register" keyword in local variable declarations (for the code + used only for debugging or which is not time-critical). + * dbg_mlc.c (GC_has_other_debug_info, GC_store_debug_info, + GC_store_debug_info_inner, GC_check_annotated_obj, GC_print_obj, + GC_print_smashed_obj, GC_debug_end_stubborn_change, + GC_debug_invoke_finalizer): Ditto. + * dyn_load.c (GC_register_dynamic_libraries): Ditto. + * mallocx.c (GC_realloc): Ditto. + * mark_rts.c (GC_print_static_roots, GC_is_static_root, + GC_clear_roots): Ditto. + * misc.c (GC_write): Ditto. + * os_dep.c (GC_print_callers): Ditto. + * dyn_load.c (GC_register_dynamic_libraries): Rename "i" local + variable to "j" for the nested loop (just not to hide the similar + variable in the outer one). + * mark_rts.c (GC_print_static_roots): Output an error message + using GC_err_printf() (instead of GC_printf()). + 2009-09-25 Ivan Maidanski (really Petter Urkedal) * configure.ac: Move include flag from ${INCLUDE} ... diff --git a/checksums.c b/checksums.c index c0a2fa21..41bec06c 100644 --- a/checksums.c +++ b/checksums.c @@ -64,9 +64,9 @@ STATIC GC_bool GC_was_faulted(struct hblk *h) STATIC word GC_checksum(struct hblk *h) { - register word *p = (word *)h; - register word *lim = (word *)(h+1); - register word result = 0; + word *p = (word *)h; + word *lim = (word *)(h+1); + word result = 0; while (p < lim) { result += *p++; @@ -100,7 +100,7 @@ int GC_n_dirty; STATIC void GC_update_check_page(struct hblk *h, int index) { page_entry *pe = GC_sums + index; - register hdr * hhdr = HDR(h); + hdr * hhdr = HDR(h); struct hblk *b; if (pe -> block != 0 && pe -> block != h + OFFSET) ABORT("goofed"); diff --git a/dbg_mlc.c b/dbg_mlc.c index e57981e3..9357712d 100644 --- a/dbg_mlc.c +++ b/dbg_mlc.c @@ -40,9 +40,9 @@ GC_API void GC_CALL GC_register_finalizer_no_order /* its part. */ GC_bool GC_has_other_debug_info(ptr_t p) { - register oh * ohdr = (oh *)p; - register ptr_t body = (ptr_t)(ohdr + 1); - register word sz = GC_size((ptr_t) ohdr); + oh * ohdr = (oh *)p; + ptr_t body = (ptr_t)(ohdr + 1); + word sz = GC_size((ptr_t) ohdr); if (HBLKPTR((ptr_t)ohdr) != HBLKPTR((ptr_t)body) || sz < DEBUG_BYTES + EXTRA_BYTES) { @@ -251,7 +251,7 @@ GC_bool GC_has_other_debug_info(ptr_t p) /* Assumes we don't hold allocation lock. */ ptr_t GC_store_debug_info(ptr_t p, word sz, const char *string, word integer) { - register word * result = (word *)((oh *)p + 1); + word * result = (word *)((oh *)p + 1); DCL_LOCK_STATE; LOCK(); @@ -281,7 +281,7 @@ ptr_t GC_store_debug_info(ptr_t p, word sz, const char *string, word integer) STATIC ptr_t GC_store_debug_info_inner(ptr_t p, word sz, char *string, word integer) { - register word * result = (word *)((oh *)p + 1); + word * result = (word *)((oh *)p + 1); GC_ASSERT(GC_size(p) >= sizeof(oh) + sz); GC_ASSERT(!(SMALL_OBJ(sz) && CROSSES_HBLK(p, sz))); @@ -309,8 +309,8 @@ STATIC ptr_t GC_store_debug_info_inner(ptr_t p, word sz, char *string, /* address. */ STATIC ptr_t GC_check_annotated_obj(oh *ohdr) { - register ptr_t body = (ptr_t)(ohdr + 1); - register word gc_sz = GC_size((ptr_t)ohdr); + ptr_t body = (ptr_t)(ohdr + 1); + word gc_sz = GC_size((ptr_t)ohdr); if (ohdr -> oh_sz + DEBUG_BYTES > gc_sz) { return((ptr_t)(&(ohdr -> oh_sz))); } @@ -381,7 +381,7 @@ STATIC void GC_print_type(ptr_t p) void GC_print_obj(ptr_t p) { - register oh * ohdr = (oh *)GC_base(p); + oh * ohdr = (oh *)GC_base(p); GC_ASSERT(I_DONT_HOLD_LOCK()); GC_err_printf("%p (", ((ptr_t)ohdr + sizeof(oh))); @@ -413,7 +413,7 @@ STATIC void GC_debug_print_heap_obj_proc(ptr_t p) /* clobbered_addr. */ STATIC void GC_print_smashed_obj(ptr_t p, ptr_t clobbered_addr) { - register oh * ohdr = (oh *)GC_base(p); + oh * ohdr = (oh *)GC_base(p); GC_ASSERT(I_DONT_HOLD_LOCK()); if (clobbered_addr <= (ptr_t)(&(ohdr -> oh_sz)) @@ -595,8 +595,8 @@ GC_API void GC_CALL GC_debug_change_stubborn(void *p) GC_API void GC_CALL GC_debug_end_stubborn_change(void *p) { - register void * q = GC_base(p); - register hdr * hhdr; + void * q = GC_base(p); + hdr * hhdr; if (q == 0) { GC_err_printf("Bad argument: %p to GC_debug_end_stubborn_change\n", p); @@ -951,7 +951,7 @@ void * GC_make_closure(GC_finalization_proc fn, void * data) void GC_CALLBACK GC_debug_invoke_finalizer(void * obj, void * data) { - register struct closure * cl = (struct closure *) data; + struct closure * cl = (struct closure *) data; (*(cl -> cl_fn))((void *)((char *)obj + sizeof(oh)), cl -> cl_data); } diff --git a/dyn_load.c b/dyn_load.c index 4056e356..f7c93601 100644 --- a/dyn_load.c +++ b/dyn_load.c @@ -188,7 +188,7 @@ void GC_register_dynamic_libraries(void) ElfW(Phdr) * p; unsigned long offset; char * start; - register int i; + int i; e = (ElfW(Ehdr) *) lm->l_addr; p = ((ElfW(Phdr) *)(((char *)(e)) + e->e_phoff)); @@ -626,7 +626,7 @@ void GC_register_dynamic_libraries(void) ElfW(Phdr) * p; unsigned long offset; char * start; - register int i; + int i; e = (ElfW(Ehdr) *) lm->l_addr; p = ((ElfW(Phdr) *)(((char *)(e)) + e->e_phoff)); @@ -752,10 +752,10 @@ void GC_register_dynamic_libraries(void) /* Known irrelevant map entries */ static int n_irr = 0; struct stat buf; - register int i; + register int j; - for (i = 0; i < n_irr; i++) { - if (map_irr[i] == start) goto irrelevant; + for (j = 0; j < n_irr; j++) { + if (map_irr[j] == start) goto irrelevant; } arg = (caddr_t)start; obj = ioctl(fd, PIOCOPENM, &arg); diff --git a/mallocx.c b/mallocx.c index e0cb011d..b5481763 100644 --- a/mallocx.c +++ b/mallocx.c @@ -81,7 +81,7 @@ GC_API void * GC_CALL GC_realloc(void * p, size_t lb) if (sz > MAXOBJBYTES) { /* Round it up to the next whole heap block */ - register word descr; + word descr; sz = (sz+HBLKSIZE-1) & (~HBLKMASK); hhdr -> hb_sz = sz; diff --git a/mark_rts.c b/mark_rts.c index 4b30a716..9aab5cb0 100644 --- a/mark_rts.c +++ b/mark_rts.c @@ -42,7 +42,7 @@ static int n_root_sets = 0; /* For debugging: */ void GC_print_static_roots(void) { - register int i; + int i; size_t total = 0; for (i = 0; i < n_root_sets; i++) { @@ -54,8 +54,8 @@ void GC_print_static_roots(void) } GC_printf("Total size: %ld\n", (unsigned long) total); if (GC_root_size != total) { - GC_printf("GC_root_size incorrect: %ld!!\n", - (unsigned long) GC_root_size); + GC_err_printf("GC_root_size incorrect: %ld!!\n", + (long) GC_root_size); } } # endif /* NO_DEBUGGING */ @@ -66,8 +66,7 @@ void GC_print_static_roots(void) GC_bool GC_is_static_root(ptr_t p) { static int last_root_set = MAX_ROOT_SETS; - register int i; - + int i; if (last_root_set < n_root_sets && p >= GC_static_roots[last_root_set].r_start @@ -254,11 +253,10 @@ GC_API void GC_CALL GC_clear_roots (void) n_root_sets = 0; GC_root_size = 0; # if !defined(MSWIN32) && !defined(MSWINCE) - { - register int i; - + { + int i; for (i = 0; i < RT_SIZE; i++) GC_root_index[i] = 0; - } + } # endif UNLOCK(); } diff --git a/misc.c b/misc.c index d49f424e..54352fbd 100644 --- a/misc.c +++ b/misc.c @@ -1043,8 +1043,8 @@ STATIC int GC_tmp; /* Should really be local ... */ && !defined(MACOS) && !defined(ECOS) && !defined(NOSYS) STATIC int GC_write(int fd, const char *buf, size_t len) { - register int bytes_written = 0; - register int result; + int bytes_written = 0; + int result; while (bytes_written < len) { # ifdef GC_SOLARIS_THREADS diff --git a/os_dep.c b/os_dep.c index 9a8fd5db..efcb1664 100644 --- a/os_dep.c +++ b/os_dep.c @@ -4152,7 +4152,7 @@ void GC_save_callers (struct callinfo info[NFRAMES]) /* Print info to stderr. We do NOT hold the allocation lock */ void GC_print_callers (struct callinfo info[NFRAMES]) { - register int i; + int i; static int reentry_count = 0; GC_bool stop = FALSE;