2 ** Copyright (C) University of Virginia, Massachusetts Institue of Technology 1994-2000.
3 ** See ../LICENSE for license information.
10 /* sgi's don't let you undef NULL */
17 # include "forwardTypes.h"
20 # define sfree(x) do { if (x != NULL) free(x); } while (FALSE)
22 extern void sfree (/*@out@*/ /*@only@*/ /*@null@*/ void *p_x) /*@modifies *p_x@*/;
29 # define getStringWord(s) (cstring_fromChars(getWord(s)))
31 extern /*@out@*/ /*@only@*/ void *dimalloc (size_t p_size, char *p_name, int p_line);
32 extern /*@only@*/ void *dicalloc (size_t p_num, size_t p_size, char *p_name, int p_line);
33 extern /*@notnull@*/ /*@out@*/ /*@only@*/ void *
34 direalloc (/*@returned@*/ /*@only@*/ /*@out@*/ /*@null@*/ void *p_x,
35 size_t p_size, char *p_name, int p_line);
37 extern /*@only@*/ void *
38 drealloc (/*@special@*/ /*@null@*/ /*@sef@*/ void *p_x,
39 /*@sef@*/ size_t p_size)
43 extern /*@out@*/ /*@only@*/ void *dmalloc (/*@sef@*/ size_t p_size) /*@*/ ;
46 # define dmalloc(s) (malloc(s))
47 # define drealloc(s,l) (realloc(s,l))
49 # define dmalloc(s) (dimalloc(s, __FILE__, __LINE__))
50 # define drealloc(s,l) (direalloc(s, l, __FILE__, __LINE__))
53 # include "system_constants.h"
58 # define free(s) ; /* nothing */
67 ** no file except general.c should use primitive
76 # define malloc(s) (dimalloc(s, __FILE__, __LINE__))
77 # define calloc(n, s) (dicalloc(n, s, __FILE__, __LINE__))
78 # define realloc(v, s) (direalloc(v, s, __FILE__, __LINE__))
86 extern void sfreeEventually (/*@owned@*/ /*@null@*/ void *p_x)
87 /*@modifies internalState@*/;
89 typedef /*@dependent@*/ char *d_char;
91 /*@constant int NOT_FOUND;@*/
92 # define NOT_FOUND (-23)
95 # error "Multiple include"