1 /* RCS $Id: alloc.h,v 1.1.1.1 2000-09-22 15:33:25 hr Exp $
4 -- Macros for allocating memory.
7 -- A somewhat nicer interface to malloc and calloc.
8 -- Here we standardise the calling convention with a common macro
12 -- Dennis Vadura, dvadura@dmake.wticorp.com
15 -- http://dmake.wticorp.com/
18 -- Copyright (c) 1996,1997 by WTI Corp. All rights reserved.
20 -- This program is NOT free software; you can redistribute it and/or
21 -- modify it under the terms of the Software License Agreement Provided
22 -- in the file <distribution-root>/readme/license.txt.
25 -- Use cvs log to obtain detailed change logs.
31 /* DO NOT CHANGE these! These are the definitions that the make source
32 * uses for allocating memory. They must be defined for make to compile
36 /* This is the only place that we define size_t now. This should be more
40 # if !defined(_TYPES_) && !defined(M_XENIX) && !defined(atarist) && !defined(_MPW) && !defined(_SIZE_T) && !defined(_SIZE_T_) && !defined(__size_t) && !defined(_WIN32)
41 # if defined(MSDOS) || defined(__MSDOS__)
43 typedef unsigned size_t;
50 #define usizeof(t) (size_t)sizeof(t)
52 #define FREE(p) free((char*)(p))
53 #define MALLOC(n, t) (t*) malloc((unsigned int)(n)*usizeof(t))
54 #define CALLOC(n, t) (t*) calloc((unsigned int)(n), usizeof(t))
56 #define TALLOC(p, n, t) if ((p = CALLOC(n, t)) == (t*)0) {No_ram();}