param: change the talloc context attached to globals structure in s3 loadparm to...
authorGarming Sam <garming@catalyst.net.nz>
Thu, 27 Feb 2014 02:20:06 +0000 (15:20 +1300)
committerJeremy Allison <jra@samba.org>
Wed, 7 May 2014 17:49:14 +0000 (19:49 +0200)
With many allocations being made, with many empty strings in loadparm, it should be more
effective to use a talloc pool instead of a normal talloc context.

The numbers chosen are based around a simple testparm instance.

Signed-off-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-on: https://gerrit.samba.org/157
Reviewed-by: Kamen Mazdrashki <kamenim@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
source3/param/loadparm.c

index fbfdb06d726e752a50d1fc80beb1f84b793951fc..9b9ebe5bd154e8b4a19e7a07fd9009561015530b 100644 (file)
@@ -678,7 +678,7 @@ static void init_globals(bool reinit_globals)
         * table once the defaults are set */
        ZERO_STRUCT(Globals);
 
-       Globals.ctx = talloc_new(NULL);
+       Globals.ctx = talloc_pooled_object(NULL, char, 272, 2048);
 
        for (i = 0; parm_table[i].label; i++) {
                if ((parm_table[i].type == P_STRING ||