Debian Codegraph @

terps/tads/tads2/mch.c

raw symbols SCIP
1 #ifdef RCSID
2 static char RCSid[] =
3 "$Header: d:/cvsroot/tads/TADS2/MCH.C,v 1.2 1999/05/17 02:52:12 MJRoberts Exp $";
4 #endif
5
6 /*
7 * Copyright (c) 1991, 2002 Michael J. Roberts. All Rights Reserved.
8 *
9 * Please see the accompanying license file, LICENSE.TXT, for information
10 * on using and copying this software.
11 */
12 /*
13 Name
14 mch.c - memory cache manager: low-level heap manager
15 Function
16 Low-level heap management functions
17 Notes
18 This is a cover for malloc that uses proper error signalling
19 conventions
20 Modified
21 08/20/91 MJRoberts - creation
22 */
23
24 #include "os.h"
25 #include "std.h"
26 #include "mch.h"
27 #include "err.h"
28
29 /* global to keep track of all allocations */
30 IF_DEBUG(ulong mchtotmem;)
31
32 uchar *mchalo(errcxdef *ctx, size_t siz, char *comment)
33 {
34 uchar *ret;
35
36 VARUSED(comment);
37 IF_DEBUG(mchtotmem += siz;)
38
39 ret = (uchar *)osmalloc(siz);
40 if (ret)
41 return(ret);
42 else
43 {
44 errsig(ctx, ERR_NOMEM);
45 NOTREACHEDV(uchar *);
46 return 0;
47 }
48 }