386BSD 0.1 development
[unix-history] / usr / src / usr.bin / awk / memory.h
CommitLineData
a7e60862
WJ
1
2/********************************************
3memory.h
4copyright 1991, Michael D. Brennan
5
6This is a source file for mawk, an implementation of
7the AWK programming language.
8
9Mawk is distributed without warranty under the terms of
10the GNU General Public License, version 2, 1991.
11********************************************/
12
13
14/* $Log: memory.h,v $
15 * Revision 5.1 91/12/05 07:59:28 brennan
16 * 1.1 pre-release
17 *
18*/
19
20
21/* memory.h */
22
23#ifndef MEMORY_H
24#define MEMORY_H
25
26#include "zmalloc.h"
27
28#define new_CELL() (CELL *) zmalloc(sizeof(CELL))
29#define free_CELL(p) zfree(p,sizeof(CELL))
30
31#ifndef SUPPRESS_NEW_STRING_PROTO
32STRING *PROTO( new_STRING, (char *, ...) ) ;
33#endif
34
35#ifdef DEBUG
36void PROTO( DB_free_STRING , (STRING *) ) ;
37
38#define free_STRING(s) DB_free_STRING(s)
39
40#else
41
42#define free_STRING(sval) if ( -- (sval)->ref_cnt == 0 )\
43 zfree(sval, (sval)->len+STRING_OH) ; else
44#endif
45
46
47#endif /* MEMORY_H */