-
Notifications
You must be signed in to change notification settings - Fork 0
/
types_string.h
44 lines (28 loc) · 990 Bytes
/
types_string.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
/********************************************
memory.h
copyright 1991,2014-2016 Michael D. Brennan
This is a source file for mawk, an implementation of
the AWK programming language.
Mawk is distributed without warranty under the terms of
the GNU General Public License, version 3, 2007.
If you import elements of this code into another product,
you agree to not name that product mawk.
********************************************/
/* types_string.h */
#ifndef MEMORY_H
#define MEMORY_H
#include "types.h"
#include "zmalloc.h"
STRING *new_STRING(const char*) ;
STRING *new_STRING0(const size_t) ;
STRING* new_STRING2(const char*, const size_t) ;
#ifdef DEBUG
void DB_free_STRING(STRING *) ;
#define free_STRING(s) DB_free_STRING(s)
#else
#define free_STRING(sval) do { \
if ( -- (sval)->ref_cnt == 0 )\
zfree(sval, STRING_SIZE((sval)->len)) ;\
} while(0)
#endif
#endif /* MEMORY_H */