Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 33 lines (26 sloc) 1.004 kb
cf92e3b @mbert Import Elvis 2.0 (written by Steve Kirkendall)
authored
1 /* safe.h */
2 /* Copyright 1995 by Steve Kirkendall */
3
4
5 #ifndef DEBUG_ALLOC
6
7 BEGIN_EXTERNC
8 extern void *safealloc P_((int qty, size_t size));
9 extern void safefree P_((void *ptr));
10 extern char *safedup P_((char *str));
11 END_EXTERNC
12 # define safekept safealloc
13 #define safekdup safedup
14 # define safeterm()
15 # define safeinspect()
16
17 #else
18
19 # define safealloc(qty, size) _safealloc(__FILE__, __LINE__, False, qty, size)
20 # define safekept(qty, size) _safealloc(__FILE__, __LINE__, True, qty, size)
21 # define safefree(ptr) _safefree(__FILE__, __LINE__, ptr)
22 # define safedup(str) _safedup(__FILE__, __LINE__, False, str)
23 # define safekdup(str) _safedup(__FILE__, __LINE__, True, str)
24 BEGIN_EXTERNC
25 extern void *_safealloc P_((char *file, int line, BOOLEAN kept, int qty, size_t size));
26 extern void _safefree P_((char *file, int line, void *ptr));
27 extern char *_safedup P_((char *file, int line, BOOLEAN kept, char *str));
28 extern void safeterm P_((void));
29 extern void safeinspect P_((void));
30 END_EXTERNC
31
32 #endif
Something went wrong with that request. Please try again.