xalloc.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 1996-2017 The Squid Software Foundation and contributors
3  *
4  * Squid software is distributed under GPLv2+ license and includes
5  * contributions from numerous individuals and organizations.
6  * Please see the COPYING and CONTRIBUTORS files for details.
7  */
8 
9 #ifndef _SQUID_COMPAT_XALLOC_H
10 #define _SQUID_COMPAT_XALLOC_H
11 
12 #ifdef __cplusplus
13 extern "C" {
14 #endif
15 
23 void *xcalloc(size_t n, size_t sz);
24 
32 void *xmalloc(size_t sz);
33 
38 void *xrealloc(void *s, size_t sz);
39 
47 void free_const(const void *s);
48 
60 static inline void xfree(const void *p) { if (p) free_const(p); }
61 
73 #define safe_free(x) while ((x)) { free_const((x)); (x) = NULL; }
74 
75 #ifdef __cplusplus
76 }
77 #endif
78 
79 #if XMALLOC_STATISTICS
80 extern void malloc_statistics(void (*func) (int, int, int, void *), void *data);
81 #endif
82 
83 #endif /* _SQUID_COMPAT_XALLOC_H */
84 
void * xcalloc(size_t n, size_t sz)
Definition: xalloc.cc:72
static void xfree(const void *p)
Definition: xalloc.h:60
char * p
Definition: membanger.c:43
void const char HLPCB void * data
Definition: stub_helper.cc:16
void free_const(const void *s)
Definition: xalloc.cc:169
void * xrealloc(void *s, size_t sz)
Definition: xalloc.cc:137
void EVH * func
Definition: stub_event.cc:16
void * xmalloc(size_t sz)
Definition: xalloc.cc:106

 

Introduction

Documentation

Support

Miscellaneous

Web Site Translations

Mirrors