home *** CD-ROM | disk | FTP | other *** search
- /* ==( bench/alloc.c )== */
-
- /* ----------------------------------------------- */
- /* Pro-C - Copyright (C) 1988, 1989 Vestronix Inc. */
- /* Modification to this source is not supported */
- /* by Vestronix Inc. */
- /* All Rights Reserved */
- /* ----------------------------------------------- */
- /* Written Nig 1-Jan-87 */
- /* Modified Geo 4-Oct-89 See comments below */
- /* ----------------------------------------------- */
- /* %W% (%H% %T%) */
-
- /*
- * Modifications
- *
- * 4-Nov-89 Geo - V2 version
- * 25-Oct-89 Geo - 1.32 Merge
- */
-
- /* Allocate a chunk of memory */
-
- # include <stdio.h>
- # include <bench.h>
-
- /*
- * standard memory allocation routine, if MDEBUG is defined then the
- * debugging version palloc is switched in.
- */
- # ifndef MDEBUG
- char *alloc(size)
- unsigned size;
- {
- char *ptr;
-
- # ifdef DEBUGI
- /*
- if (size > 5000)
- {
- fprintf(stderr, "\nAlloc [%u]\n", size); fflush(stderr);
- getchar();
- }
- */
- # endif
-
- ptr = calloc(size, sizeof(char));
-
- if (ptr == NULL)
- {
- fprintf(stderr, "\nOut of memory"); fflush(stderr);
- exit(-1);
- }
- return ptr;
- }
-
- # endif
-
-