[master] d9c1916 Add a per-method specific pointer to the vrt-context, and use it to slim down req/busyobj a tiny bit.

Dridi Boukelmoune dridi at varni.sh
Thu May 14 17:24:30 CEST 2015


On Thu, May 14, 2015 at 5:12 PM, Poul-Henning Kamp <phk at phk.freebsd.dk> wrote:
> --------
> In message <CABoVN9ADMWEfJtP1epOO_s==KgOrzB_jk8SmvUHTRtVMwRZW-Q at mail.gmail.com>, Dridi Boukelmoune writes:
>
>>If you don't like the idea of the union type, there's a typo you can fix with:
>
> I do indeed not like unions.
>
> I use them only when they are absolutely necessary to share a memory allocation
> is a quasi-type-safe way, where the chances of f**kups are well handled in other
> ways.
>
> I never use them to pretend I have type-safety on a single pointer.

It was never about safety, but readability.

With many NULLs in the code, I need to go other places to fully
understand a piece of code. Named argument make sometimes
things more explicit:
-       VCL_recv_method(req->vcl, wrk, req, NULL, NULL);
+       VCL_recv_method(req->vcl, wrk, req, NULL, no_specific);

I also just assumed switching to a union type would not add
overhead in the compiled binary.

Cheers,
Dridi

>>   sed -i s/SHA256ctx/SHA256Context/ include/vrt.h
>
> done.
>
> --
> 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