Memory management in VMODS: sp->ws vs. sp->wrk->ws

Carlos Abalde carlos.abalde at gmail.com
Wed Oct 30 17:33:19 CET 2013


Hi there,

I hope this is the correct mailing list for a VMOD development question.

After reading all the available documentation and also reviewing implementations of almost all VMODs in https://www.varnish-cache.org/vmods, I'm not sure what is the difference between using sp->ws and sp->wrk->ws when allocating memory in a VMOD method. It seems sp->wrk->sp is the way to go when using WS_Reserve() and WS_Release(). However, when using WS_Alloc() or WS_Dup() I've seen modules using both sp->ws and sp->wrk->sp. I guess it's not a random choice, but I haven't been able to identify any rule.

Is there any difference? Any hint on when to use sp->ws and when sp->wrk->sp?

Thanks!

--
Carlos Abalde.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 203 bytes
Desc: Message signed with OpenPGP using GPGMail
URL: <https://www.varnish-cache.org/lists/pipermail/varnish-dev/attachments/20131030/7d5d1c51/attachment.pgp>


More information about the varnish-dev mailing list