+2009-09-25 Ivan Maidanski <ivmai@mail.ru>
+
+ * 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 <ivmai@mail.ru> (really Petter Urkedal)
* configure.ac: Move include flag from ${INCLUDE} ...
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++;
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");
/* 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) {
/* 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();
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)));
/* 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)));
}
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)));
/* 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))
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);
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);
}
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));
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));
/* 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);
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;
/* 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++) {
}
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 */
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
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();
}
&& !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
/* 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;