[BACK]Return to nogc.c CVS log [TXT][DIR] Up to [local] / OpenXM / src / kan96xx / Kan

Annotation of OpenXM/src/kan96xx/Kan/nogc.c, Revision 1.5

1.5     ! takayama    1: /* $OpenXM: OpenXM/src/kan96xx/Kan/nogc.c,v 1.4 2004/02/27 09:46:46 takayama Exp $ */
1.1       maekawa     2: #include <stdio.h>
                      3: static long Total = 0;
1.4       takayama    4: unsigned int GC_version=0;
1.1       maekawa     5:
                      6: void *GC_malloc(n)
1.3       takayama    7:      int n;
1.1       maekawa     8: {
                      9:   void *p;
                     10:   p = (void *)calloc(n,1);  /* clear the memory */
                     11:
                     12:   Total += n;
                     13:   if (p == (void *)NULL) {
                     14:     fprintf(stderr,"\nNo more memory. We have allocated %ld bytes of the memory.\n",Total);
                     15:     return(p);
                     16:   }
                     17:   return(p);
                     18: }
                     19:
                     20: void *GC_realloc(void *p,int n) {
                     21:   void *p;
                     22:   p = (void *)realloc(p,n);
                     23:
                     24:   Total += n;
                     25:   if (p == (void *)NULL) {
                     26:     fprintf(stderr,"\nNo more memory. We have allocated %ld bytes of the memory.\n",Total);
                     27:     return(p);
                     28:   }
                     29:   return(p);
                     30: }
                     31:
                     32: GC_free(void *p) {  ; }
                     33:
1.5     ! takayama   34: GC_version(void) { return(GC_version); }
        !            35:
        !            36:
1.1       maekawa    37:

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