r1983: a completely new implementation of talloc
authorAndrew Tridgell <tridge@samba.org>
Sat, 21 Aug 2004 01:54:46 +0000 (01:54 +0000)
committerGerald (Jerry) Carter <jerry@samba.org>
Wed, 10 Oct 2007 17:58:14 +0000 (12:58 -0500)
commitb83ba93eaeb2dcb0bf11615591d886fda84e4162
treeb2fe3c5a6ea7a9bd1f5f416e545ee26d4a207ac5
parent326f562e72c0776f469a8af93e25a2cc94dff60e
r1983: 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().
(This used to be commit e35bb094c52e550b3105dd1638d8d90de71d854f)
43 files changed:
source4/auth/auth_sam.c
source4/include/talloc.h
source4/lib/data_blob.c
source4/lib/registry/common/reg_interface.c
source4/lib/registry/reg_backend_dir/reg_backend_dir.c
source4/lib/registry/reg_backend_gconf/reg_backend_gconf.c
source4/lib/registry/reg_backend_ldb/reg_backend_ldb.c
source4/lib/talloc.c
source4/lib/tallocmsg.c
source4/lib/util_str.c
source4/lib/util_unistr.c
source4/lib/util_uuid.c
source4/libads/ldap.c
source4/libcli/clilist.c
source4/libcli/ldap/ldap.c
source4/libcli/ldap/ldap_ldif.c
source4/libcli/raw/clisession.c
source4/libcli/raw/clisocket.c
source4/libcli/raw/clitransport.c
source4/libcli/raw/clitree.c
source4/libcli/raw/raweas.c
source4/libcli/raw/rawfile.c
source4/libcli/raw/rawfileinfo.c
source4/libcli/raw/rawreadwrite.c
source4/libcli/raw/rawrequest.c
source4/libcli/raw/rawtrans.c
source4/librpc/ndr/ndr.c
source4/librpc/rpc/dcerpc.c
source4/librpc/rpc/dcerpc_smb.c
source4/ntvfs/ipc/ipc_rap.c
source4/ntvfs/reference/ref_util.c
source4/ntvfs/simple/svfs_util.c
source4/ntvfs/simple/vfs_simple.c
source4/rpc_server/dcerpc_server.c
source4/rpc_server/epmapper/rpc_epmapper.c
source4/rpc_server/netlogon/dcerpc_netlogon.c
source4/rpc_server/samr/dcesrv_samr.c
source4/smb_server/request.c
source4/smb_server/trans2.c
source4/torture/rap/rap.c
source4/torture/raw/open.c
source4/torture/raw/search.c
source4/torture/rpc/winreg.c