a completely new implementation of talloc
authortridge <tridge@0c0555d6-39d7-0310-84fc-f1cc0bd64818>
Sat, 21 Aug 2004 01:54:46 +0000 (01:54 +0000)
committertridge <tridge@0c0555d6-39d7-0310-84fc-f1cc0bd64818>
Sat, 21 Aug 2004 01:54:46 +0000 (01:54 +0000)
commit05bb3734ca229d436398839fb9aaea742be7126c
tree8ea283c2fcf6b0963ce9572802bf7a1cf0211f91
parent4b0e108ceef15249459db66aa36b3a3e3a735854
a completely new implementation of talloc

This version does the following:

  1) talloc_free(), talloc_realloc() and talloc_steal() lose their
     (redundent) first arguments

  2) you can use _any_ talloc pointer as a talloc context to allocate
     more memory. This allows you to create complex data structures
     where the top level structure is the logical parent of the next
     level down, and those are the parents of the level below
     that. Then destroy either the lot with a single talloc_free() or
     destroy any sub-part with a talloc_free() of that part

  3) you can name any pointer. Use talloc_named() which is just like
     talloc() but takes the printf style name argument as well as the
     parent context and the size.

The whole thing ends up being a very simple piece of code, although
some of the pointer walking gets hairy.

So far, I'm just using the new talloc() like the old one. The next
step is to actually take advantage of the new interface
properly. Expect some new commits soon that simplify some common
coding styles in samba4 by using the new talloc().

git-svn-id: svn+ssh://svn.samba.org/data/svn/samba/branches/SAMBA_4_0@1983 0c0555d6-39d7-0310-84fc-f1cc0bd64818
43 files changed:
source/auth/auth_sam.c
source/include/talloc.h
source/lib/data_blob.c
source/lib/registry/common/reg_interface.c
source/lib/registry/reg_backend_dir/reg_backend_dir.c
source/lib/registry/reg_backend_gconf/reg_backend_gconf.c
source/lib/registry/reg_backend_ldb/reg_backend_ldb.c
source/lib/talloc.c
source/lib/tallocmsg.c
source/lib/util_str.c
source/lib/util_unistr.c
source/lib/util_uuid.c
source/libads/ldap.c
source/libcli/clilist.c
source/libcli/ldap/ldap.c
source/libcli/ldap/ldap_ldif.c
source/libcli/raw/clisession.c
source/libcli/raw/clisocket.c
source/libcli/raw/clitransport.c
source/libcli/raw/clitree.c
source/libcli/raw/raweas.c
source/libcli/raw/rawfile.c
source/libcli/raw/rawfileinfo.c
source/libcli/raw/rawreadwrite.c
source/libcli/raw/rawrequest.c
source/libcli/raw/rawtrans.c
source/librpc/ndr/ndr.c
source/librpc/rpc/dcerpc.c
source/librpc/rpc/dcerpc_smb.c
source/ntvfs/ipc/ipc_rap.c
source/ntvfs/reference/ref_util.c
source/ntvfs/simple/svfs_util.c
source/ntvfs/simple/vfs_simple.c
source/rpc_server/dcerpc_server.c
source/rpc_server/epmapper/rpc_epmapper.c
source/rpc_server/netlogon/dcerpc_netlogon.c
source/rpc_server/samr/dcesrv_samr.c
source/smb_server/request.c
source/smb_server/trans2.c
source/torture/rap/rap.c
source/torture/raw/open.c
source/torture/raw/search.c
source/torture/rpc/winreg.c