+2011-05-03 Ivan Maidanski <ivmai@mail.ru>
+
+ * dbg_mlc.c (GC_store_debug_info_inner, GC_store_debug_info):
+ Rename "integer" argument to "linenum"; change the type of the
+ argument to int.
+ * gcj_mlc.c (GC_store_debug_info): Ditto.
+ * dbg_mlc.c (GET_OH_LINENUM): New macro.
+ * dbg_mlc.c (GC_print_obj, GC_print_smashed_obj): Use
+ GET_OH_LINENUM; adjust print format specifier.
+ * dbg_mlc.c (GC_debug_malloc, GC_debug_malloc_ignore_off_page,
+ GC_debug_malloc_atomic_ignore_off_page,
+ GC_debug_generic_malloc_inner,
+ GC_debug_generic_malloc_inner_ignore_off_page,
+ GC_debug_malloc_stubborn, GC_debug_malloc_atomic,
+ GC_debug_malloc_uncollectable,
+ GC_debug_malloc_atomic_uncollectable): Remove unnecessary cast of
+ "i".
+ * gcj_mlc.c (GC_debug_gcj_malloc): Ditto.
+
2011-04-26 Ivan Maidanski <ivmai@mail.ru>
* .cvsignore (initsecondarythread, test_cpp): Add.
/* Store debugging info into p. Return displaced pointer. */
/* This version assumes we do hold the allocation lock. */
STATIC ptr_t GC_store_debug_info_inner(ptr_t p, word sz, const char *string,
- word integer)
+ int linenum)
{
word * result = (word *)((oh *)p + 1);
((oh *)p) -> oh_bg_ptr = HIDE_BACK_PTR((ptr_t)0);
# endif
((oh *)p) -> oh_string = string;
- ((oh *)p) -> oh_int = integer;
+ ((oh *)p) -> oh_int = linenum;
# ifndef SHORT_DBG_HDRS
((oh *)p) -> oh_sz = sz;
((oh *)p) -> oh_sf = START_FLAG ^ (word)result;
}
GC_INNER ptr_t GC_store_debug_info(ptr_t p, word sz, const char *string,
- word integer)
+ int linenum)
{
ptr_t result;
DCL_LOCK_STATE;
LOCK();
- result = GC_store_debug_info_inner(p, sz, string, integer);
+ result = GC_store_debug_info_inner(p, sz, string, linenum);
UNLOCK();
return result;
}
}
}
+#define GET_OH_LINENUM(ohdr) ((int)(ohdr)->oh_int)
+
/* Print a human-readable description of the object to stderr. p points */
/* to somewhere inside an object with the debugging info. */
STATIC void GC_print_obj(ptr_t p)
GC_err_printf("%p (", ((ptr_t)ohdr + sizeof(oh)));
GC_err_puts(ohdr -> oh_string);
# ifdef SHORT_DBG_HDRS
- GC_err_printf(":%ld, ", (unsigned long)(ohdr -> oh_int));
+ GC_err_printf(":%d, ", GET_OH_LINENUM(ohdr));
# else
- GC_err_printf(":%ld, sz=%ld, ", (unsigned long)(ohdr -> oh_int),
- (unsigned long)(ohdr -> oh_sz));
+ GC_err_printf(":%d, sz=%lu, ",
+ GET_OH_LINENUM(ohdr), (unsigned long)(ohdr -> oh_sz));
# endif
GC_print_type((ptr_t)(ohdr + 1));
GC_err_puts(")\n");
clobbered_addr, p,
(unsigned long)(GC_size((ptr_t)ohdr) - DEBUG_BYTES));
} else {
- GC_err_printf("%p in or near object at %p(%s:%lu, sz=%lu)\n",
+ GC_err_printf("%p in or near object at %p (%s:%d, sz=%lu)\n",
clobbered_addr, p,
(word)(ohdr -> oh_string) < HBLKSIZE ? "(smashed string)" :
ohdr -> oh_string[0] == '\0' ? "EMPTY(smashed?)" :
ohdr -> oh_string,
- (unsigned long)(ohdr -> oh_int),
- (unsigned long)(ohdr -> oh_sz));
+ GET_OH_LINENUM(ohdr), (unsigned long)(ohdr -> oh_sz));
PRINT_CALL_CHAIN(ohdr);
}
}
GC_start_debugging();
}
ADD_CALL_CHAIN(result, ra);
- return (GC_store_debug_info(result, (word)lb, s, (word)i));
+ return (GC_store_debug_info(result, (word)lb, s, i));
}
GC_API void * GC_CALL GC_debug_malloc_ignore_off_page(size_t lb,
GC_start_debugging();
}
ADD_CALL_CHAIN(result, ra);
- return (GC_store_debug_info(result, (word)lb, s, (word)i));
+ return (GC_store_debug_info(result, (word)lb, s, i));
}
GC_API void * GC_CALL GC_debug_malloc_atomic_ignore_off_page(size_t lb,
GC_start_debugging();
}
ADD_CALL_CHAIN(result, ra);
- return (GC_store_debug_info(result, (word)lb, s, (word)i));
+ return (GC_store_debug_info(result, (word)lb, s, i));
}
#ifdef DBG_HDRS_ALL
return(0);
}
ADD_CALL_CHAIN(result, GC_RETURN_ADDR);
- return (GC_store_debug_info_inner(result, (word)lb, "INTERNAL", (word)0));
+ return (GC_store_debug_info_inner(result, (word)lb, "INTERNAL", 0));
}
GC_INNER void * GC_debug_generic_malloc_inner_ignore_off_page(size_t lb,
return(0);
}
ADD_CALL_CHAIN(result, GC_RETURN_ADDR);
- return (GC_store_debug_info_inner(result, (word)lb, "INTERNAL", (word)0));
+ return (GC_store_debug_info_inner(result, (word)lb, "INTERNAL", 0));
}
#endif /* DBG_HDRS_ALL */
GC_start_debugging();
}
ADD_CALL_CHAIN(result, ra);
- return (GC_store_debug_info(result, (word)lb, s, (word)i));
+ return (GC_store_debug_info(result, (word)lb, s, i));
}
GC_API void GC_CALL GC_debug_change_stubborn(void *p)
GC_start_debugging();
}
ADD_CALL_CHAIN(result, ra);
- return (GC_store_debug_info(result, (word)lb, s, (word)i));
+ return (GC_store_debug_info(result, (word)lb, s, i));
}
GC_API char * GC_CALL GC_debug_strdup(const char *str, GC_EXTRA_PARAMS)
GC_start_debugging();
}
ADD_CALL_CHAIN(result, ra);
- return (GC_store_debug_info(result, (word)lb, s, (word)i));
+ return (GC_store_debug_info(result, (word)lb, s, i));
}
#ifdef ATOMIC_UNCOLLECTABLE
GC_start_debugging();
}
ADD_CALL_CHAIN(result, ra);
- return (GC_store_debug_info(result, (word)lb, s, (word)i));
+ return (GC_store_debug_info(result, (word)lb, s, i));
}
#endif /* ATOMIC_UNCOLLECTABLE */