[master] 074d164ea Only instantiate the necessary VRBT functions

Poul-Henning Kamp phk at FreeBSD.org
Tue Mar 23 09:53:04 UTC 2021


commit 074d164ea0129cf40456d2ac92b2853e78f2149d
Author: Poul-Henning Kamp <phk at FreeBSD.org>
Date:   Tue Mar 23 09:52:24 2021 +0000

    Only instantiate the necessary VRBT functions

diff --git a/bin/varnishd/cache/cache_vrt_priv.c b/bin/varnishd/cache/cache_vrt_priv.c
index 307b3c9cb..03e684834 100644
--- a/bin/varnishd/cache/cache_vrt_priv.c
+++ b/bin/varnishd/cache/cache_vrt_priv.c
@@ -52,7 +52,11 @@ struct vrt_privs cli_task_privs[1];
 static inline int vrt_priv_dyncmp(const struct vrt_priv *,
     const struct vrt_priv *);
 
-VRBT_PROTOTYPE_STATIC(vrt_privs, vrt_priv, entry, vrt_priv_dyncmp)
+VRBT_GENERATE_INSERT_COLOR(vrt_privs, vrt_priv, entry, static)
+VRBT_GENERATE_FIND(vrt_privs, vrt_priv, entry, vrt_priv_dyncmp, static)
+VRBT_GENERATE_INSERT(vrt_privs, vrt_priv, entry, vrt_priv_dyncmp, static)
+VRBT_GENERATE_MINMAX(vrt_privs, vrt_priv, entry, static)
+VRBT_GENERATE_NEXT(vrt_privs, vrt_priv, entry, static)
 
 /*--------------------------------------------------------------------
  */
@@ -113,8 +117,6 @@ vrt_priv_dyncmp(const struct vrt_priv *vp1, const struct vrt_priv *vp2)
 	return (0);
 }
 
-VRBT_GENERATE_STATIC(vrt_privs, vrt_priv, entry, vrt_priv_dyncmp)
-
 static struct vmod_priv *
 vrt_priv_dynamic_get(const struct vrt_privs *privs, uintptr_t vmod_id)
 {
diff --git a/bin/varnishtop/varnishtop.c b/bin/varnishtop/varnishtop.c
index 8d8d572e8..d8e2b6183 100644
--- a/bin/varnishtop/varnishtop.c
+++ b/bin/varnishtop/varnishtop.c
@@ -110,10 +110,18 @@ cmp_order(const struct top *a, const struct top *b)
 	return (cmp_key(a, b));
 }
 
-VRBT_PROTOTYPE_STATIC(t_order, top, e_order, cmp_order)
-VRBT_GENERATE_STATIC(t_order, top, e_order, cmp_order)
-VRBT_PROTOTYPE_STATIC(t_key, top, e_key, cmp_key)
-VRBT_GENERATE_STATIC(t_key, top, e_key, cmp_key)
+VRBT_GENERATE_INSERT_COLOR(t_order, top, e_order, static)
+VRBT_GENERATE_INSERT(t_order, top, e_order, cmp_order, static)
+VRBT_GENERATE_REMOVE_COLOR(t_order, top, e_order, static)
+VRBT_GENERATE_MINMAX(t_order, top, e_order, static)
+VRBT_GENERATE_NEXT(t_order, top, e_order, static)
+VRBT_GENERATE_REMOVE(t_order, top, e_order, static)
+
+VRBT_GENERATE_INSERT_COLOR(t_key, top, e_key, static)
+VRBT_GENERATE_REMOVE_COLOR(t_key, top, e_key, static)
+VRBT_GENERATE_INSERT(t_key, top, e_key, cmp_key, static)
+VRBT_GENERATE_REMOVE(t_key, top, e_key, static)
+VRBT_GENERATE_FIND(t_key, top, e_key, cmp_key, static)
 
 static int v_matchproto_(VSLQ_dispatch_f)
 accumulate(struct VSL_data *vsl, struct VSL_transaction * const pt[],
diff --git a/lib/libvarnishapi/vsl_dispatch.c b/lib/libvarnishapi/vsl_dispatch.c
index 47b100ea4..e68fa4e29 100644
--- a/lib/libvarnishapi/vsl_dispatch.c
+++ b/lib/libvarnishapi/vsl_dispatch.c
@@ -228,8 +228,11 @@ vtx_keycmp(const struct vtx_key *a, const struct vtx_key *b)
 	return (0);
 }
 
-VRBT_PROTOTYPE_STATIC(vtx_tree, vtx_key, entry, vtx_keycmp)
-VRBT_GENERATE_STATIC(vtx_tree, vtx_key, entry, vtx_keycmp)
+VRBT_GENERATE_REMOVE_COLOR(vtx_tree, vtx_key, entry, static)
+VRBT_GENERATE_REMOVE(vtx_tree, vtx_key, entry, static)
+VRBT_GENERATE_INSERT_COLOR(vtx_tree, vtx_key, entry, static)
+VRBT_GENERATE_INSERT(vtx_tree, vtx_key, entry, vtx_keycmp, static)
+VRBT_GENERATE_FIND(vtx_tree, vtx_key, entry, vtx_keycmp, static)
 
 static enum vsl_status v_matchproto_(vslc_next_f)
 vslc_raw_next(const struct VSL_cursor *cursor)


More information about the varnish-commit mailing list