diff options
author | Andrew Tridgell <tridge@samba.org> | 2009-07-01 14:53:01 +1000 |
---|---|---|
committer | Andrew Tridgell <tridge@samba.org> | 2009-07-01 15:15:37 +1000 |
commit | 5fe1d8dc1275e43d96da1297f5fb0d0088a1c3ab (patch) | |
tree | ca520776101c3ff64fa76d01d088c565ea265d5a /source4/libcli | |
parent | 6a192020a230ab8e085f32b5559c0fe0d2f5c1a4 (diff) | |
download | samba-5fe1d8dc1275e43d96da1297f5fb0d0088a1c3ab.tar.gz samba-5fe1d8dc1275e43d96da1297f5fb0d0088a1c3ab.tar.bz2 samba-5fe1d8dc1275e43d96da1297f5fb0d0088a1c3ab.zip |
changes to remove the ambiguity in talloc_free() and talloc_steal()
These changes follow from the discussions on samba-technical. The
changes are in several parts, and stem from the inherent ambiguity
that was in talloc_free() and talloc_steal() when the pointer that is
being changes has more than one parent, via references.
The changes are:
1) when you call talloc_free() on a pointer with more than one parent
the free will fail, and talloc will log an error to stderr like this:
ERROR: talloc_free with references at some/foo.c:123
reference at other/bar.c:201
reference at other/foobar.c:641
2) Similarly, when you call talloc_steal() on a pointer with more
than one parent, the steal will fail and talloc will log an error to
stderr like this:
ERROR: talloc_steal with references at some/foo.c:123
reference at other/bar.c:201
3) A new function talloc_reparent() has been added to change a parent
in a controlled fashion. You need to supply both the old parent and
the new parent. It handles the case whether either the old parent was
a normal parent or a reference
The use of stderr in the logging is ugly (and potentially dangerous),
and will be removed in a future patch. We'll need to add a debug
registration function to talloc.
Diffstat (limited to 'source4/libcli')
0 files changed, 0 insertions, 0 deletions