r17958: as talloc_init() enabled null tracking, we should avoid to use it
authorStefan Metzmacher <metze@samba.org>
Thu, 31 Aug 2006 09:26:43 +0000 (09:26 +0000)
committerGerald (Jerry) Carter <jerry@samba.org>
Wed, 10 Oct 2007 19:16:57 +0000 (14:16 -0500)
in smbtorture, and in the LOCAL-TALLOC we should reset the null tracking

also make bin/smbtorture //url/foo LOCAL-TALLOC LOCAL-TALLOC possible

metze
(This used to be commit d1dd3df5e4fd21f5cbd00e472438fe3eadb266e5)

source4/lib/talloc/testsuite.c
source4/torture/gentest.c
source4/torture/misc.c
source4/torture/smbtorture.c
source4/torture/util_smb.c

index 013f01cc2cfdf606df224f618767834011c0e7f7..ca5e9042d349ce5130fb5677d9a4fed9ca4a30d7 100644 (file)
@@ -910,6 +910,7 @@ static BOOL test_loop(void)
                printf("FAILED TO FIRE LOOP DESTRUCTOR\n");
                return False;
        }
+       loop_destructor_count = 0;
 
        return True;
 }
@@ -1021,6 +1022,7 @@ BOOL torture_local_talloc(struct torture_context *torture)
 {
        BOOL ret = True;
 
+       talloc_disable_null_tracking();
        talloc_enable_null_tracking();
 
        ret &= test_ref1();
index 0ee60f8a1821895b27cf9767977ce10759f0f882..b8dc2362eaea7579a4bb2a6b09e6a6a3fddbbf6f 100644 (file)
@@ -1970,7 +1970,7 @@ static int run_test(void)
                current_op.opnum = op;
                current_op.name = gen_ops[which_op].name;
                current_op.status = NT_STATUS_OK;
-               current_op.mem_ctx = talloc_init("%s", current_op.name);
+               current_op.mem_ctx = talloc_named(NULL, 0, "%s", current_op.name);
 
                ret = gen_ops[which_op].handler(instance);
 
index f04b7782ebe344720b1d65ee1c6078cb54fd8f28..62b956337c91604242d89c8b74069bd1d8761c49 100644 (file)
@@ -395,7 +395,7 @@ static BOOL torture_ioctl_test(struct torture_context *torture)
                return False;
        }
 
-       mem_ctx = talloc_init("ioctl_test");
+       mem_ctx = talloc_named_const(torture, 0, "ioctl_test");
 
        printf("starting ioctl test\n");
 
@@ -786,7 +786,7 @@ static BOOL run_benchrw(struct torture_context *torture)
                torture_numops,torture_nprocs);
 
        /*init talloc context*/
-       mem_ctx = talloc_init("bench-readwrite");
+       mem_ctx = talloc_named_const(torture, 0, "bench-readwrite");
        ev = event_context_init(mem_ctx);
        state = talloc_array(mem_ctx, struct benchrw_state *, torture_nprocs);
 
index 8d7552e0752c8c4c224d7b5cc5509142ec254f0e..d66e11b01be7d8450f79fcbbd942b351f1b26970 100644 (file)
@@ -195,7 +195,7 @@ static void usage(poptContext pc)
 
 static BOOL is_binding_string(const char *binding_string)
 {
-       TALLOC_CTX *mem_ctx = talloc_init("is_binding_string");
+       TALLOC_CTX *mem_ctx = talloc_named_const(NULL, 0, "is_binding_string");
        struct dcerpc_binding *binding_struct;
        NTSTATUS status;
        
index c1e4edc5e6f10a29de50b44c0de225f124b08fba..b823e69b7511a4e0852eead1f3b49d7c94e57c0e 100644 (file)
@@ -53,7 +53,7 @@ NTSTATUS create_directory_handle(struct smbcli_tree *tree, const char *dname, in
        union smb_open io;
        TALLOC_CTX *mem_ctx;
 
-       mem_ctx = talloc_init("create_directory_handle");
+       mem_ctx = talloc_named_const(tree, 0, "create_directory_handle");
 
        io.generic.level = RAW_OPEN_NTCREATEX;
        io.ntcreatex.in.root_fid = 0;
@@ -329,7 +329,7 @@ void dump_all_info(TALLOC_CTX *mem_ctx, union smb_fileinfo *finfo)
 */
 void torture_all_info(struct smbcli_tree *tree, const char *fname)
 {
-       TALLOC_CTX *mem_ctx = talloc_init("%s", fname);
+       TALLOC_CTX *mem_ctx = talloc_named(tree, 0, "%s", fname);
        union smb_fileinfo finfo;
        NTSTATUS status;
 
@@ -373,7 +373,7 @@ NTSTATUS torture_set_sparse(struct smbcli_tree *tree, int fnum)
        NTSTATUS status;
        TALLOC_CTX *mem_ctx;
 
-       mem_ctx = talloc_init("torture_set_sparse");
+       mem_ctx = talloc_named_const(tree, 0, "torture_set_sparse");
        if (!mem_ctx) {
                return NT_STATUS_NO_MEMORY;
        }