[PATCH] Add a miniobj macro for pointer acquisitions

Poul-Henning Kamp phk at phk.freebsd.dk
Thu Mar 17 12:50:39 CET 2016

In message <CABoVN9COqLsa72X4Qa-=ft7eqNUbsDiBY2e3fBbzLQQkSFUEDA at mail.gmail.com>, Dridi Boukelmoune writes:

>In this evening's offline self-hackathon in the train I came up with a
>macro for a recurring pattern in Varnish Cache that I also happen to
>use in at least one VMOD so it might benefit others too.

I agree that we should beautify this pattern, but I can't get used
to the word "ACQUIRE" for it, particular because we are inside a
"release" functionality.

Could we call it "TAKE_OBJ_NOTMULL()" ?

That matches what we are doing to the object reference much better.

I think TAKEOVER_OBJ_NOTNULL() would be too clunky?

Poul-Henning Kamp       | UNIX since Zilog Zeus 3.20
phk at FreeBSD.ORG         | TCP/IP since RFC 956
FreeBSD committer       | BSD since 4.3-tahoe    
Never attribute to malice what can adequately be explained by incompetence.

More information about the varnish-dev mailing list