svn commit: samba r20570 - in branches/SAMBA_4_0/source/libnet:
.
Stefan (metze) Metzmacher
metze at samba.org
Wed Jan 10 11:30:05 GMT 2007
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
tridge at samba.org schrieb:
> Andrew,
>
> > > This matter in this case because strlower_talloc() over allocates
> > >
> > > tridge: how should we fix this in lib/talloc/?
> >
> > I can't imagine anyone who expects this behaviour: The extra strlen()
> > is a small price to pay for sanity. You are not meant to know that
> > talloc() has magic internal state...
>
> unfortunately if we change this it makes a loop which appends strings
> O(n^2) instead of O(n). We use talloc_asprintf_append() in a loop like
> that in a few places, and those could become unbearably slow if we use
> strlen each time (eg. when constructing a schema).
>
> I'd rather fix strlower_talloc() to do a talloc_realloc() at the end
> so it has the right size.
yep, that was also one of my ideas...
metze
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2 (GNU/Linux)
Comment: Using GnuPG with SUSE - http://enigmail.mozdev.org
iD8DBQFFpM48m70gjA5TCD8RAsyaAJ0UvBO9q6m59ydUdb0NigIh4sdlzQCgqNIN
uCBkdE4GHAyqQGCcUB2Q8nI=
=neq7
-----END PGP SIGNATURE-----
More information about the samba-technical
mailing list