[master] 16cf6597d Release docs: Polish advise on VRT_Assign_Backend

Nils Goroll nils.goroll at uplex.de
Mon Mar 14 13:38:06 UTC 2022

commit 16cf6597dccd59042dfc6dc36b64c57c0d7a8499
Author: Nils Goroll <nils.goroll at uplex.de>
Date:   Mon Mar 14 14:30:01 2022 +0100

    Release docs: Polish advise on VRT_Assign_Backend
    Removed one paragraph which was really confusing and, I guess, wrong:
    IIUC, backend references _always_ need to be taken with VRT_Assign_Backend,
    because the referencing vmod can make _no_ assumptions about the assigned
    Also I hope to have clarified use of VRT_StaticDirector().

diff --git a/doc/sphinx/whats-new/upgrading-trunk.rst b/doc/sphinx/whats-new/upgrading-trunk.rst
index fa1b77d56..8a439d212 100644
--- a/doc/sphinx/whats-new/upgrading-trunk.rst
+++ b/doc/sphinx/whats-new/upgrading-trunk.rst
@@ -114,14 +114,11 @@ Assignments should be replaced as such::
     -lvalue = expr;
     +VRT_Assign_Backend(&lvalue, expr);
-It doesn't have to be strictly assigned this way, as long as when presented to
-a VMOD a backend is accounted for as long as it is referenced.
+.. XXX: there should be a coccinelle patch to help.
-XXX: there should be a coccinelle patch to help.
-On the other hand, if a backend is created dynamically but is guaranteed by
-the VMOD not to be removed before its owning VCL is discarded, it can opt out
-of reference counting with ``VRT_StaticDirector()``.
+For backends which are guaranteed at least VCL lifetime, the
+respective VMOD can opt out of reference counting with
+``VRT_StaticDirector()`` to avoid the reference counting overhead.

More information about the varnish-commit mailing list