[PATCH] group_mapping: Avoid a talloc

Volker Lendecke Volker.Lendecke at SerNet.DE
Wed Jan 8 14:17:07 MST 2014

On Thu, Jan 09, 2014 at 09:22:42AM +1300, Andrew Bartlett wrote:
> I can see the argument for stuff in tight inner loops, but I'm very,
> very wary of going back to fixed length strings everywhere.  What's the
> whole argument of talloc_pool() that this was fast enough, without all
> the risks of fixed length strings?

No, talloc_pool is not fast enough. If you have to make a
Rasperry Pi level box saturate a gigabit link every single
cycle counts. In particular the case where we have
sid2string and we know the maximum length of the target
string, there is value in not doing

> There is a great value in consistency of talloc-based string handling,
> because it means that we can realistically examine our fixed length
> string use, because it's rare, not used anywhere we might save a cycle
> or two outside the hot path.

Please take a look at full_path_tos(): The normal case will
do it on the stack, but it does provide an overflow
mechanism with talloc.

By the way, one of the hottest routines is talloc_free these
days. Every talloc has to go through that, even if it comes
from a talloc_pool.


SerNet GmbH, Bahnhofsallee 1b, 37081 Göttingen
phone: +49-551-370000-0, fax: +49-551-370000-9
AG Göttingen, HRB 2816, GF: Dr. Johannes Loxen
http://www.sernet.de, mailto:kontakt at sernet.de

More information about the samba-technical mailing list