[master] 818f00c Make vmod_priv_fini() a real function and name it VRT_priv_fini() for consistency.

Poul-Henning Kamp phk at FreeBSD.org
Mon Mar 10 08:31:00 CET 2014


commit 818f00c637486c17168412fc7c188d9051a31cf6
Author: Poul-Henning Kamp <phk at FreeBSD.org>
Date:   Mon Mar 10 07:30:35 2014 +0000

    Make vmod_priv_fini() a real function and name it VRT_priv_fini()
    for consistency.

diff --git a/bin/varnishd/cache/cache_vrt.c b/bin/varnishd/cache/cache_vrt.c
index ce536e5..f78f140 100644
--- a/bin/varnishd/cache/cache_vrt.c
+++ b/bin/varnishd/cache/cache_vrt.c
@@ -498,6 +498,16 @@ VRT_purge(const struct vrt_ctx *ctx, double ttl, double grace)
 }
 
 /*--------------------------------------------------------------------
+ */
+
+void
+VRT_priv_fini(const struct vmod_priv *p)
+{
+	if (p->priv != (void*)0 && p->free != (void*)0)
+		p->free(p->priv);
+}
+
+/*--------------------------------------------------------------------
  * Simple stuff
  */
 
diff --git a/include/vrt.h b/include/vrt.h
index 9b3664a..dc84852 100644
--- a/include/vrt.h
+++ b/include/vrt.h
@@ -246,13 +246,7 @@ struct vmod_priv {
 
 typedef int vmod_init_f(struct vmod_priv *,  const struct VCL_conf *);
 
-static inline void
-vmod_priv_fini(const struct vmod_priv *p)
-{
-
-	if (p->priv != (void*)0 && p->free != (void*)0)
-		p->free(p->priv);
-}
+void VRT_priv_fini(const struct vmod_priv *p);
 
 /* Stevedore related functions */
 int VRT_Stv(const char *nm);
diff --git a/lib/libvcc/vcc_expr.c b/lib/libvcc/vcc_expr.c
index 08f91df..c143cf1 100644
--- a/lib/libvcc/vcc_expr.c
+++ b/lib/libvcc/vcc_expr.c
@@ -561,7 +561,7 @@ vcc_func(struct vcc *tl, struct expr **e, const char *cfunc,
 			bprintf(buf, "vmod_priv_%u", tl->unique++);
 			ifp = New_IniFin(tl);
 			Fh(tl, 0, "static struct vmod_priv %s;\n", buf);
-			VSB_printf(ifp->fin, "\tvmod_priv_fini(&%s);", buf);
+			VSB_printf(ifp->fin, "\tVRT_priv_fini(&%s);", buf);
 			e2 = vcc_mk_expr(VOID, "&%s", buf);
 			p += strlen(p) + 1;
 		} else if (fmt == ENUM) {
diff --git a/lib/libvcc/vcc_vmod.c b/lib/libvcc/vcc_vmod.c
index ac88b59..044cd24 100644
--- a/lib/libvcc/vcc_vmod.c
+++ b/lib/libvcc/vcc_vmod.c
@@ -119,7 +119,7 @@ vcc_ParseImport(struct vcc *tl)
 	VSB_printf(ifp->ini, "\t\treturn(1);");
 
 	/* XXX: zero the function pointer structure ?*/
-	VSB_printf(ifp->fin, "\tvmod_priv_fini(&vmod_priv_%.*s);", PF(mod));
+	VSB_printf(ifp->fin, "\tVRT_priv_fini(&vmod_priv_%.*s);", PF(mod));
 	VSB_printf(ifp->fin, "\n\tVRT_Vmod_Fini(&VGC_vmod_%.*s);", PF(mod));
 
 	ifp = NULL;
diff --git a/lib/libvmod_debug/vmod_debug.c b/lib/libvmod_debug/vmod_debug.c
index 7109644..146f46b 100644
--- a/lib/libvmod_debug/vmod_debug.c
+++ b/lib/libvmod_debug/vmod_debug.c
@@ -126,6 +126,6 @@ vmod_blob2hex(const struct vrt_ctx *ctx, VCL_BLOB b)
 		p += 2;
 		q += 1;
 	}
-	vmod_priv_fini(b);
+	VRT_priv_fini(b);
 	return (s);
 }



More information about the varnish-commit mailing list