OSDN Git Service

Daily bump.
[pf3gnuchains/gcc-fork.git] / boehm-gc / mallocx.c
index 06f4562..5ad593d 100644 (file)
@@ -147,6 +147,16 @@ int obj_kind;
 # endif
 
 # ifdef REDIRECT_REALLOC
+
+/* As with malloc, avoid two levels of extra calls here.       */
+# ifdef GC_ADD_CALLER
+#   define RA GC_RETURN_ADDR,
+# else
+#   define RA
+# endif
+# define GC_debug_realloc_replacement(p, lb) \
+       GC_debug_realloc(p, lb, RA "unknown", 0)
+
 # ifdef __STDC__
     GC_PTR realloc(GC_PTR p, size_t lb)
 # else
@@ -157,10 +167,13 @@ int obj_kind;
   {
     return(REDIRECT_REALLOC(p, lb));
   }
+
+# undef GC_debug_realloc_replacement
 # endif /* REDIRECT_REALLOC */
 
 
-/* The same thing, except caller does not hold allocation lock.        */
+/* Allocate memory such that only pointers to near the                 */
+/* beginning of the object are considered.                     */
 /* We avoid holding allocation lock while we clear memory.     */
 ptr_t GC_generic_malloc_ignore_off_page(lb, k)
 register size_t lb;
@@ -202,7 +215,7 @@ register int k;
     if (0 == result) {
         return((*GC_oom_fn)(lb));
     } else {
-       if (init & !GC_debugging_started) {
+       if (init && !GC_debugging_started) {
            BZERO(result, n_blocks * HBLKSIZE);
         }
         return(result);