5 Author: Pekka Riikonen <priikone@silcnet.org>
7 Copyright (C) 2002 Pekka Riikonen
9 This program is free software; you can redistribute it and/or modify
10 it under the terms of the GNU General Public License as published by
11 the Free Software Foundation; version 2 of the License.
13 This program is distributed in the hope that it will be useful,
14 but WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 GNU General Public License for more details.
24 #error "Do not include this file directly"
27 #if defined(__GNUC__) && defined(__i386__)
30 #define silc_malloc(s) silc_st_malloc((s), __FILE__, __LINE__)
31 #define silc_calloc(i, s) silc_st_calloc((i), (s), __FILE__, __LINE__)
32 #define silc_realloc(p, s) silc_st_realloc((p), (s), __FILE__, __LINE__)
33 #define silc_free(p) silc_st_free((p), __FILE__, __LINE__)
34 #define silc_memdup(p, s) silc_st_memdup((p), (s), __FILE__, __LINE__)
35 #define strdup(s) silc_st_strdup((s), __FILE__, __LINE__)
37 void *silc_st_malloc(size_t size, const char *file, int line);
38 void *silc_st_calloc(size_t items, size_t size, const char *file, int line);
39 void *silc_st_realloc(void *ptr, size_t size, const char *file, int line);
40 void silc_st_free(void *ptr, const char *file, int line);
41 void *silc_st_memdup(const void *ptr, size_t size, const char *file, int line);
42 void *silc_st_strdup(const char *string, const char *file, int line);
43 void silc_st_dump(void);
46 #error "memory allocation stack trace not supported on this platform"
47 #endif /* __GNUC__ && __i386__ */
49 #endif /* STACKTRACE_H */