1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-11 05:18:09 +03:00
Commit Graph

61 Commits

Author SHA1 Message Date
Rusty Russell
4f331872bc talloc: don't allow a talloc_pool inside a talloc_pool.
We explicitly call free() on a pool which falls to zero, assuming it's
not inside another pool (we crash).  Check on creation and explicitly
document this case.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2012-07-18 04:54:31 +09:30
Pavel Březina
bdeee2202d Talloc doc: talloc_strdup_append does not return duplicated string 2012-04-24 13:28:38 +02:00
Pavel Březina
9a474717b8 Talloc doc: when s == NULL in _append functions 2012-04-24 13:28:34 +02:00
Volker Lendecke
c4c8845930 Talloc doc: Fix a cut&paste error
Autobuild-User: Volker Lendecke <vl@samba.org>
Autobuild-Date: Wed Apr 18 11:59:49 CEST 2012 on sn-devel-104
2012-04-18 11:59:49 +02:00
Pavel Březina
64fdcda0c7 Talloc doc: talloc_pool() when not enough memory in the pool 2012-04-18 10:27:17 +02:00
Pavel Březina
75bcb28a95 Talloc doc: TALLOC_FREE_FILL 2012-04-18 10:27:16 +02:00
Pavel Březina
f8b589b793 Talloc doc: talloc_set_log_stderr()
Documents this function.
2012-04-18 10:27:16 +02:00
Pavel Březina
cf7f4612b5 Talloc doc: talloc_set_log_fn()
Documents this function.
2012-04-18 10:27:16 +02:00
Pavel Březina
73b0ed650a Talloc doc: talloc_set_abort_fn()
Documents this function.
2012-04-18 10:27:16 +02:00
Pavel Březina
30ca3915e5 Talloc doc: talloc_asprintf_append_buffer()
Explains the difference between _append and _append_buffer.
2012-04-18 10:27:16 +02:00
Pavel Březina
50689aee38 Talloc doc: talloc_strndup_append_buffer()
Explains the difference between _append and _append_buffer.
2012-04-18 10:27:16 +02:00
Pavel Březina
c5243a499f Talloc doc: talloc_strndup_append()
The destination string is reallocated instead of duplicating the result.
2012-04-18 10:27:15 +02:00
Pavel Březina
3502371a34 Talloc doc: talloc_strdup_append_buffer()
Explains the difference between _append and _append_buffer.
2012-04-18 10:27:15 +02:00
Pavel Březina
b233173f85 Talloc doc: talloc_strdup_append()
The destination string is reallocated instead of duplicating the result.
2012-04-18 10:27:15 +02:00
Matthias Dieter Wallnöfer
513574afd7 talloc - some documentation changes
- Fix some typos
- Document better the differences in the behaviour between talloc 1.X and 2.X.
  Previously this seemed a bit spongy to me.

Reviewed-by: Jelmer + Tridge

Autobuild-User: Matthias Dieter Wallnöfer <mdw@samba.org>
Autobuild-Date: Mon Apr  4 11:05:42 CEST 2011 on sn-devel-104
2011-04-04 11:05:42 +02:00
Matthias Dieter Wallnöfer
6723e90d52 talloc - improve doxygen comment of "talloc_move"
Express better that this should be a pointer of a pointer.

Reviewed-by: Tridge
2011-03-30 08:45:58 +02:00
Brad Hards
564830ef90 talloc: Typo fix for api docs 2011-01-04 14:46:07 +11:00
Simo Sorce
feb6034581 talloc: make header C++ safe
Autobuild-User: Simo Sorce <idra@samba.org>
Autobuild-Date: Wed Oct 20 18:15:09 UTC 2010 on sn-devel-104
2010-10-20 18:15:09 +00:00
Volker Lendecke
e325a5b674 talloc: Add a warning about talloc_autofree_context() and dlclose() 2010-09-24 17:21:42 -07:00
Matthias Dieter Wallnöfer
2de63aa280 talloc:documentation - explain that "talloc_free" works also with "NULL" pointers
(talloc.c)
...
> static inline int _talloc_free_internal(void *ptr, const char *location)
> {
>        struct talloc_chunk *tc;
>
>        if (unlikely(ptr == NULL)) {
>                return -1;
>        }
>
>        tc = talloc_chunk_from_ptr(ptr);
...

Obviously this never had been documented before.
2010-08-14 18:48:20 +02:00
Andreas Schneider
82900073fb talloc: Documented the missing string functions. 2010-05-06 18:14:09 +02:00
Holger Hans Peter Freyther
485def3b5d talloc: Documentation fix for talloc 2010-05-01 15:20:24 +02:00
Andrew Tridgell
1b4bbec523 talloc: add a define for TALLOC_MAX_DEPTH
Thanks to the suggestion from simo
2010-04-02 18:52:29 +11:00
Kamen Mazdrashki
d142d9fb64 doxygen: talloc_get_type name fixed in Doxygen documentation
Signed-off-by: Stefan Metzmacher <metze@samba.org>
2010-03-10 17:11:55 +01:00
Simo Sorce
1422a94654 talloc: Fix abi checks and ifdefs
teach the abi check scripts to skip the DOXYGEN sections
fix the header to use #ifdef DOXYGEN and not #if DOXYGEN
2010-02-08 10:02:49 -05:00
Andrew Tridgell
7fed22eb0a talloc: fixed doc typo 2010-02-08 11:04:59 +11:00
Andreas Schneider
da0e396deb Move the talloc details to the mainpage.
Signed-off-by: Andrew Tridgell <tridge@samba.org>
2010-02-08 11:04:59 +11:00
Andreas Schneider
fbd646a783 talloc: Documented talloc with doxygen.
Signed-off-by: Andrew Tridgell <tridge@samba.org>
2010-02-08 11:04:59 +11:00
Andrew Tridgell
3c5d763962 talloc: fixed talloc_disable_null_tracking()
When we disable null tracking, we need to move any existing objects
that are under the null_context to be parented by the true NULL
context.

We also need a new talloc_enable_null_tracking_no_autofree() function,
as the talloc testsuite cannot cope with the moving of the autofree
context under the null_context as it wants to check exact counts of
objects under the null_context, and smbtorture has a large number of
objects in the autofree_context from .init functions
2009-09-20 13:14:40 -07:00
Stefan Metzmacher
6c9ace27c5 talloc: add defines and functions for TALLOC_MAJOR/MINOR_VERSION
We also use the major and minor versions in the TALLOC_MAGIC,
so that we can detect if two conflicting versions of talloc
are loaded in one process. In this case we use talloc_log() to
output a very useful debug message before we call
talloc_abort().

metze
2009-08-24 16:29:58 +10:00
Stefan Metzmacher
5760edeeb6 talloc: remove ABI compat functions
metze
2009-08-24 16:29:58 +10:00
Stefan Metzmacher
e40f3144f2 talloc: add talloc_set_log_fn() and talloc_set_log_stderr()
So that the application can setup a log function to get ERROR
and WARNING messages.

metze
2009-08-24 16:29:58 +10:00
Simo Sorce
2738178d13 Restore ABI compatibility for talloc. 2009-07-03 08:45:29 -04:00
Andrew Tridgell
5fe1d8dc12 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.
2009-07-01 15:15:37 +10:00
Stefan Metzmacher
eff9bcc9c7 talloc: try to fix the source4 build on AIX
metze
2009-06-08 09:40:11 +02:00
Volker Lendecke
979a1b06d0 talloc_array_length: talloc_get_size deals fine with NULL 2009-03-22 22:10:09 +01:00
Volker Lendecke
a83c18062a Revert "Convert the contents of talloc_guide.txt to doxygen-style talloc.h comments"
This reverts commit d21212c919.
2009-03-22 09:48:48 +01:00
Volker Lendecke
b7fb083dd7 Revert "Add a default "undocumented" module"
This reverts commit ba42320c7e.
2009-03-22 09:48:34 +01:00
Volker Lendecke
790326cc38 Revert "Add some initial hook to the front page"
This reverts commit cfce2d3611.
2009-03-22 09:48:27 +01:00
Volker Lendecke
5098f4625e Revert "Reformatting"
This reverts commit db447d0c47.
2009-03-22 09:48:19 +01:00
Volker Lendecke
c67ea37d62 Revert "Document talloc_pool()"
This reverts commit 27944ed745.
2009-03-22 09:48:14 +01:00
Volker Lendecke
6b1a5bbf02 Revert "Add a talloc_internal "module""
This reverts commit 02662d56c6.
2009-03-22 09:48:06 +01:00
Volker Lendecke
cce595d1fc Revert "Document _talloc"
This reverts commit 2ce70d4f5a.
2009-03-22 09:47:59 +01:00
Volker Lendecke
f15a0305f3 Revert "Document TALLOC_FREE()"
This reverts commit 3f81649b8d.
2009-03-22 09:47:51 +01:00
Volker Lendecke
c086c26ffb Revert "Document talloc_parent, talloc_parent_name and talloc_is_parent"
This reverts commit 986c2e01cc.
2009-03-22 09:47:44 +01:00
Volker Lendecke
257ea7e6f1 Revert "Document talloc_zero_array()"
This reverts commit 59dff57455.
2009-03-22 09:47:37 +01:00
Volker Lendecke
59dff57455 Document talloc_zero_array() 2009-03-21 23:57:24 +01:00
Volker Lendecke
986c2e01cc Document talloc_parent, talloc_parent_name and talloc_is_parent 2009-03-21 23:50:33 +01:00
Volker Lendecke
3f81649b8d Document TALLOC_FREE() 2009-03-21 20:04:17 +01:00
Volker Lendecke
2ce70d4f5a Document _talloc 2009-03-21 20:04:17 +01:00