From: des Date: Thu, 15 Nov 2007 15:07:15 +0000 (+0000) Subject: Add a VALID_OBJ() predicate macro. X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8f10e250bd43715dd901c64bdee2ecdf2abdfbe6;p=varnish Add a VALID_OBJ() predicate macro. git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@2253 d4fa192b-c00b-0410-8231-f00ffab90ce4 --- diff --git a/varnish-cache/include/miniobj.h b/varnish-cache/include/miniobj.h index a620f8f9..2565f102 100644 --- a/varnish-cache/include/miniobj.h +++ b/varnish-cache/include/miniobj.h @@ -12,6 +12,9 @@ free(to); \ } while (0) +#define VALID_OBJ(ptr, type_magic) \ + ((ptr) != NULL && (ptr)->magic == (type_magic)) + #define CHECK_OBJ(ptr, type_magic) \ do { \ assert((ptr)->magic == type_magic); \