[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.3

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

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