]> err.no Git - varnish/commitdiff
Give struct ws the mini_obj treatment, not sure why I didn't before.
authorphk <phk@d4fa192b-c00b-0410-8231-f00ffab90ce4>
Mon, 29 Oct 2007 12:10:16 +0000 (12:10 +0000)
committerphk <phk@d4fa192b-c00b-0410-8231-f00ffab90ce4>
Mon, 29 Oct 2007 12:10:16 +0000 (12:10 +0000)
git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@2189 d4fa192b-c00b-0410-8231-f00ffab90ce4

varnish-cache/bin/varnishd/cache.h
varnish-cache/bin/varnishd/cache_ws.c

index e2336942e2e74e59bbbdb518452b442b3bb16ac3..6970ae29700f7b470dd2dfedab8d31760bbcfb7f 100644 (file)
@@ -90,6 +90,8 @@ enum step {
  */
 
 struct ws {
+       unsigned                magic;
+#define WS_MAGIC               0x35fac554
        const char              *id;            /* identity */
        char                    *s;             /* (S)tart of buffer */
        char                    *f;             /* (F)ree pointer */
index 2ef8bcee2913fe5e1f371a286f052c3e6002cd71..176c0bce3e515cb14c2517c4fe9b60e281e0360c 100644 (file)
@@ -56,7 +56,7 @@ void
 WS_Assert(const struct ws *ws)
 {
 
-       assert(ws != NULL);
+       CHECK_OBJ_NOTNULL(ws, WS_MAGIC);
        WS_DEBUG((SLT_Debug, 0, "WS(%p = (%s, %p %u %u %u)",
            ws, ws->id, ws->s, pdiff(ws->s, ws->f),
            ws->r == NULL ? 0 : pdiff(ws->f, ws->r),
@@ -79,6 +79,7 @@ WS_Init(struct ws *ws, const char *id, void *space, unsigned len)
        WS_DEBUG((SLT_Debug, 0, "WS_Init(%p, \"%s\", %p, %u)", ws, id, space, len));
        assert(space != NULL);
        memset(ws, 0, sizeof *ws);
+       ws->magic = WS_MAGIC;
        ws->s = space;
        ws->e = ws->s + len;
        ws->f = ws->s;