[BACK]Return to malloc.c CVS log [TXT][DIR] Up to [local] / OpenXM_contrib2 / asir2000 / gc

Diff for /OpenXM_contrib2/asir2000/gc/malloc.c between version 1.3 and 1.6

version 1.3, 2001/04/20 07:39:19 version 1.6, 2003/06/24 05:11:33
Line 182  register int k;
Line 182  register int k;
     ptr_t result;      ptr_t result;
     DCL_LOCK_STATE;      DCL_LOCK_STATE;
   
       if (GC_have_errors) GC_print_all_errors();
     GC_INVOKE_FINALIZERS();      GC_INVOKE_FINALIZERS();
     if (SMALL_OBJ(lb)) {      if (SMALL_OBJ(lb)) {
         DISABLE_SIGNALS();          DISABLE_SIGNALS();
Line 294  DCL_LOCK_STATE;
Line 295  DCL_LOCK_STATE;
             return(GENERAL_MALLOC((word)lb, NORMAL));              return(GENERAL_MALLOC((word)lb, NORMAL));
         }          }
         /* See above comment on signals.        */          /* See above comment on signals.        */
           GC_ASSERT(0 == obj_link(op)
                     || (word)obj_link(op)
                           <= (word)GC_greatest_plausible_heap_addr
                        && (word)obj_link(op)
                           >= (word)GC_least_plausible_heap_addr);
         *opp = obj_link(op);          *opp = obj_link(op);
         obj_link(op) = 0;          obj_link(op) = 0;
         GC_words_allocd += lw;          GC_words_allocd += lw;
Line 315  DCL_LOCK_STATE;
Line 321  DCL_LOCK_STATE;
     /* It might help to manually inline the GC_malloc call here.        */      /* It might help to manually inline the GC_malloc call here.        */
     /* But any decent compiler should reduce the extra procedure call   */      /* But any decent compiler should reduce the extra procedure call   */
     /* to at most a jump instruction in this case.                      */      /* to at most a jump instruction in this case.                      */
 #   if defined(I386) && defined(SOLARIS_THREADS)  #   if defined(I386) && defined(GC_SOLARIS_THREADS)
       /*        /*
        * Thread initialisation can call malloc before         * Thread initialisation can call malloc before
        * we're ready for it.         * we're ready for it.
Line 324  DCL_LOCK_STATE;
Line 330  DCL_LOCK_STATE;
        * inopportune times.         * inopportune times.
        */         */
       if (!GC_is_initialized) return sbrk(lb);        if (!GC_is_initialized) return sbrk(lb);
 #   endif /* I386 && SOLARIS_THREADS */  #   endif /* I386 && GC_SOLARIS_THREADS */
     return((GC_PTR)REDIRECT_MALLOC(lb));      return((GC_PTR)REDIRECT_MALLOC(lb));
   }    }
   
Line 337  DCL_LOCK_STATE;
Line 343  DCL_LOCK_STATE;
   {    {
     return((GC_PTR)REDIRECT_MALLOC(n*lb));      return((GC_PTR)REDIRECT_MALLOC(n*lb));
   }    }
   
   #ifndef strdup
   # include <string.h>
   # ifdef __STDC__
       char *strdup(const char *s)
   # else
       char *strdup(s)
       char *s;
   # endif
     {
       size_t len = strlen(s) + 1;
       char * result = ((char *)REDIRECT_MALLOC(len+1));
       BCOPY(s, result, len+1);
       return result;
     }
   #endif /* !defined(strdup) */
    /* If strdup is macro defined, we assume that it actually calls malloc, */
    /* and thus the right thing will happen even without overriding it.     */
    /* This seems to be true on most Linux systems.                         */
   
 # endif /* REDIRECT_MALLOC */  # endif /* REDIRECT_MALLOC */
   
 /* Explicitly deallocate an object p.                           */  /* Explicitly deallocate an object p.                           */
Line 359  DCL_LOCK_STATE;
Line 385  DCL_LOCK_STATE;
         /* Required by ANSI.  It's not my fault ...     */          /* Required by ANSI.  It's not my fault ...     */
     h = HBLKPTR(p);      h = HBLKPTR(p);
     hhdr = HDR(h);      hhdr = HDR(h);
       GC_ASSERT(GC_base(p) == p);
 #   if defined(REDIRECT_MALLOC) && \  #   if defined(REDIRECT_MALLOC) && \
         (defined(SOLARIS_THREADS) || defined(LINUX_THREADS) \          (defined(GC_SOLARIS_THREADS) || defined(GC_LINUX_THREADS) \
          || defined(__MINGW32__)) /* Should this be MSWIN32 in general? */           || defined(__MINGW32__)) /* Should this be MSWIN32 in general? */
         /* For Solaris, we have to redirect malloc calls during         */          /* For Solaris, we have to redirect malloc calls during         */
         /* initialization.  For the others, this seems to happen        */          /* initialization.  For the others, this seems to happen        */
Line 440  void GC_free_inner(GC_PTR p)
Line 467  void GC_free_inner(GC_PTR p)
 }  }
 #endif /* THREADS */  #endif /* THREADS */
   
 # ifdef REDIRECT_MALLOC  # if defined(REDIRECT_MALLOC) && !defined(REDIRECT_FREE)
   #   define REDIRECT_FREE GC_free
   # endif
   # ifdef REDIRECT_FREE
 #   ifdef __STDC__  #   ifdef __STDC__
       void free(GC_PTR p)        void free(GC_PTR p)
 #   else  #   else
Line 449  void GC_free_inner(GC_PTR p)
Line 479  void GC_free_inner(GC_PTR p)
 #   endif  #   endif
   {    {
 #   ifndef IGNORE_FREE  #   ifndef IGNORE_FREE
       GC_free(p);        REDIRECT_FREE(p);
 #   endif  #   endif
   }    }
 # endif  /* REDIRECT_MALLOC */  # endif  /* REDIRECT_MALLOC */

Legend:
Removed from v.1.3  
changed lines
  Added in v.1.6

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>