-------- In message <camnfqgp-jct2dyktmfp49255m6jybz8hpoz6drze5hpukwr...@mail.gmail.com> , =?UTF-8?Q?P=C3=A5l_Hermunn_Johansen?= writes:
>Subject: [PATCH] Use calloc instead of malloc to allocate extra VSM space. > >With malloc we would read from uninitialized memory (implicitly with ++ or +=). > >Also expanded comment: When we need to allocate extra VSM space >with malloc/calloc, the space will not be available to other >processes. The workaround is to increase VSM space through the >runtime parameter vsm_space. Good catch. The comment isn't going to help anybody very much though, it would be a better idea to improve on the comments on the vsm_overflow[ed] counters where people can see them. Personally the "did/does" difference was too subtle for me to spot, and I spent some time trying to find out why we had two counters with the exact same definition. It does not look like we emit a SLT_Error record when this happens, I think we should. VSM_Alloc() looks like the best place for it, but there is a chicken and egg issue since VSM_Alloc is also used to allocate the VSL buffer. -- Poul-Henning Kamp | UNIX since Zilog Zeus 3.20 [email protected] | TCP/IP since RFC 956 FreeBSD committer | BSD since 4.3-tahoe Never attribute to malice what can adequately be explained by incompetence. _______________________________________________ varnish-dev mailing list [email protected] https://www.varnish-cache.org/lists/mailman/listinfo/varnish-dev
