PATCH: util-env

Trever L. Adams trever at middleearth.sapphiresunday.org
Wed Oct 12 18:10:45 UTC 2016


On 10/12/2016 08:50 AM, Volker Lendecke wrote:
> "Trever L. Adams" <trever at middleearth.sapphiresunday.org> writes:
>
>> It appears that the envz functions use the array of char * internally.
>> There isn't a need for a conversion. Depending on which seems more
>> straightforward would you consider a patch to change the internal
>> representation to be that way?
> One motivation for me was to reduce the memory footprint of string
> lists. Having a talloc hierarchy of independent char * strings is adds a
> few dozen bytes per string, talloc is pretty heavy-weight these
> days. That's why I chose the buffer with embedded 0-chars for the argv
> thing. I know might be pointless micro-optimization. If it's not
> possible to make it work on top of that representation, it will be
> better just use your patch 1:1. I'll then go back converting that later,
> once it's in and proven to work in your code. This is nothing that
> should block your code to go in.
>
> Sorry for the noise,
>
> Volker
>
I absolutely agree with you thinking. I don't know all the ins and outs
of talloc, so thank you for the heads up.

If you agree with this patch, I believe I have replaced the util-env
functionality with everything working with strv. It also removes the
need for util-env and so that patch is hereby withdrawn.

Thank you!

Trever

-------------- next part --------------
A non-text attachment was scrubbed...
Name: strv.patch
Type: text/x-patch
Size: 1063 bytes
Desc: not available
URL: <http://lists.samba.org/pipermail/samba-technical/attachments/20161012/29b06051/strv.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 872 bytes
Desc: OpenPGP digital signature
URL: <http://lists.samba.org/pipermail/samba-technical/attachments/20161012/29b06051/signature.sig>


More information about the samba-technical mailing list