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