Commit 264bbab3 authored by Poul-Henning Kamp's avatar Poul-Henning Kamp

Add ALLOC_OBJ macro


git-svn-id: http://www.varnish-cache.org/svn/trunk/varnish-cache@2470 d4fa192b-c00b-0410-8231-f00ffab90ce4
parent ea32abba
...@@ -6,6 +6,13 @@ ...@@ -6,6 +6,13 @@
* $Id$ * $Id$
*/ */
#define ALLOC_OBJ(to, type_magic) \
do { \
(to) = calloc(sizeof *(to), 1); \
if ((to) != NULL) \
(to)->magic = (type_magic); \
} while (0)
#define FREE_OBJ(to) \ #define FREE_OBJ(to) \
do { \ do { \
(to)->magic = (0); \ (to)->magic = (0); \
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment