static char *SccsId = "@(#)malloc.c 4.10 (TU-Delft) 04/26/93";

#include <stdio.h>

#define MY_MALLOC 		/* configuration */
/* #define RCHECK 		/* configuration */
/* #define MALLOC_VERIFY  	/* configuration */
/* #define MSTATS	  	/* configuration */

/* #undef MY_MALLOC /**/

#ifdef cadmus		/* this does not work on cadmus */
#undef MY_MALLOC
#endif


/* This malloc has problems on a sun4 (maybe also sun3) running yellow pages. */
#ifdef sun
#undef MY_MALLOC
#endif

#undef MY_MALLOC


/*
 * Stub in case of use of standard libc malloc.
 *
 * returns (size * num).
 */
int mallocFit (size, num)
unsigned size;
unsigned num;
{
    return ((int) (num));
}


#ifdef DRIVER

/* test driver and example */
main ()
{
    struct x {
	int i;
	char c;
	double d;
    } * p;
    static struct x y = {
	1,
	'a',
	123.456
    };

    char * m[100];
    int i;


    p = malloc (sizeof (struct x));
    memcpy (p, &y, sizeof (struct x));
    printf ("i: %d, c: %c, d: %g\n", p -> i, p -> c, p -> d);
    free (p);
}
#endif /* DRIVER */
