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

File: [local] / OpenXM / src / kan96xx / Kan / nogc.c (download)

Revision 1.2, Sun Jan 16 07:55:39 2000 UTC (24 years, 4 months ago) by takayama
Branch: MAIN
CVS Tags: maekawa-ipv6, RELEASE_20000124, RELEASE_1_1_3, RELEASE_1_1_2
Changes since 1.1: +1 -0 lines

Congratulation of sm1 version 3.* !

/* $OpenXM: OpenXM/src/kan96xx/Kan/nogc.c,v 1.2 2000/01/16 07:55:39 takayama Exp $ */
#include <stdio.h>
static long Total = 0;

void *GC_malloc(n)
int n;
{
  void *p;
  p = (void *)calloc(n,1);  /* clear the memory */

  Total += n;
  if (p == (void *)NULL) {
    fprintf(stderr,"\nNo more memory. We have allocated %ld bytes of the memory.\n",Total);
    return(p);
  }
  return(p);
}

void *GC_realloc(void *p,int n) {
  void *p;
  p = (void *)realloc(p,n);

  Total += n;
  if (p == (void *)NULL) {
    fprintf(stderr,"\nNo more memory. We have allocated %ld bytes of the memory.\n",Total);
    return(p);
  }
  return(p);
}

GC_free(void *p) {  ; }