Commit 818f00c6 authored by Poul-Henning Kamp's avatar Poul-Henning Kamp

Make vmod_priv_fini() a real function and name it VRT_priv_fini()

for consistency.
parent 41db0bc0
......@@ -497,6 +497,16 @@ VRT_purge(const struct vrt_ctx *ctx, double ttl, double grace)
ttl, 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
*/
......
......@@ -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);
......
......@@ -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) {
......
......@@ -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;
......
......@@ -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);
}
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