1
0
mirror of https://github.com/samba-team/samba.git synced 2025-12-12 12:23:50 +03:00
Commit Graph

47 Commits

Author SHA1 Message Date
Stefan Metzmacher
bc94aa19f3 r25216: make talloc_append_string() a deprecated macro instead of
having it as a real function.

metze
(This used to be commit 2b2e841465)
2007-10-10 15:06:56 -05:00
Stefan Metzmacher
46d369b0f0 r25208: add talloc_str[n]dup_append[_buffer]() functions
metze
(This used to be commit 8532076720)
2007-10-10 15:06:53 -05:00
Jeremy Allison
151f422247 r25164: Add talloc_asprintf_append_buffer() and the docs for it.
Jeremy.
(This used to be commit 5bb8613b86)
2007-10-10 15:06:44 -05:00
Andrew Tridgell
6c973f4e8c r23798: updated old Temple Place FSF addresses to new URL
(This used to be commit 40c0919aaa)
2007-10-10 14:59:15 -05:00
Andrew Tridgell
b8d69a7ea2 r23795: more v2->v3 conversion
(This used to be commit 84b468b2f8)
2007-10-10 14:59:14 -05:00
Jeremy Allison
522f9ace14 r22563: As tridge requested remove the _strict calls - for Samba3 I'm moving
to a separate file.
Jeremy.
(This used to be commit 80706cf98d)
2007-10-10 14:51:44 -05:00
Jeremy Allison
ca3a7a5578 r22541: Added talloc_size_strict macro.
Jeremy.
(This used to be commit 219e1cae77)
2007-10-10 14:51:40 -05:00
Jeremy Allison
3477721278 r22540: Added _strict varients of the macro calls - added
prototypes.
Jeremy.
(This used to be commit ba1a66cc6f)
2007-10-10 14:51:40 -05:00
Jeremy Allison
b06fc3b53c r22539: Added _strict varients of the talloc calls to
return NULL on size == 0 varients.
Jeremy.
(This used to be commit 1ef269067c)
2007-10-10 14:51:39 -05:00
Stefan Metzmacher
9f7406f795 r22267: protect #define __location__ with an #ifndef
metze
(This used to be commit 138ffd6d48)
2007-10-10 14:50:55 -05:00
Jelmer Vernooij
97416e6b01 r21297: Remove the GTK+ tools and library from the main repository. They are now maintained separately in bzr at http://people.samba.org/bzr/jelmer/samba-gtk
This also adds some more headers to the list that is installed and a couple of extra #include lines so these
headers can be used externally without problems.
(This used to be commit 07652f65ce)
2007-10-10 14:48:04 -05:00
Stefan Metzmacher
bfbf6d546b r20193: - let talloc_parent_chunk() handle a NULL pointer
- use talloc_parent_chunk() in talloc_parent_name()
- add prototype of talloc_parent_name()

metze
(This used to be commit 85fc18f047)
2007-10-10 14:29:21 -05:00
Andrew Tridgell
c902a8927c r18521: implement volkers suggestion for avoiding the type punning warnings
(This used to be commit 9b9f058edb)
2007-10-10 14:18:41 -05:00
Andrew Tridgell
05cdd9ccaf r18439: 2nd try at a talloc_move() api. This type with the ** ptr interface
exposed.

Unfortunately this generates a large number of type punning
warnings. We'll have to find some magic to hide those.
(This used to be commit 254cbf09de)
2007-10-10 14:18:29 -05:00
Andrew Tridgell
1a59784451 r18435: added a function talloc_move() which is like talloc_steal(), but is
meant for moving pointers between structures. The difference is that
talloc_move() will zero the source pointer, thus ensuring you don't
reference the pointer in the old context.

talloc_move() is appropriate in some, but not all cases where we use
talloc_steal() now. The interface came out of a discussion with
Jeremy.
(This used to be commit 200756017e)
2007-10-10 14:18:29 -05:00
Stefan Metzmacher
832ac85ba3 r17907: - add a generic talloc_report_depth_cb() function which takes a callback
to do the actual report.
- make the talloc_report_depth_file() a wrapper of it
- and talloc_report() and talloc_report_full() are wrapper of
  talloc_report_depth_file()

metze
(This used to be commit b199557b35)
2007-10-10 14:16:54 -05:00
Stefan Metzmacher
59057c8d56 r17895: - talloc_increase_ref_count() can fail
- make talloc_reference() typesafe when gcc >= 3 is used

metze
(This used to be commit 933d1b47ad)
2007-10-10 14:16:53 -05:00
Stefan Metzmacher
3400d91197 r17893: add a function to disable the null_context
metze
(This used to be commit 7cab4285b1)
2007-10-10 14:16:52 -05:00
Stefan Metzmacher
45b8c41038 r17891: remove c++ warnings from talloc
metze
(This used to be commit fb73ce8d43)
2007-10-10 14:16:52 -05:00
Stefan Metzmacher
5ed074715a r17886: add talloc_ptrtype() and talloc_array_ptrtype(),
see the manpage what they do:-)

metze
(This used to be commit bfca83c91e)
2007-10-10 14:16:51 -05:00
Stefan Metzmacher
82d4c5095d r17885: use _TALLOC_TYPEPF() consitently
metze
(This used to be commit 155cd6b882)
2007-10-10 14:16:51 -05:00
Andrew Tridgell
f23be49188 r17645: gcc 4.1.x has started producing "value computed is not used" warnings
in very annoying ways for talloc_steal. This rather strange looking
cpp approach avoids these warnings. It's really a problem in gcc, but
better to do this than put up with the huge flood of warnings.
(This used to be commit 8236a0ac5e)
2007-10-10 14:16:19 -05:00
Stefan Metzmacher
02ea24bcd1 r17263: export talloc_free_children()
metze
(This used to be commit 195754b169)
2007-10-10 14:10:24 -05:00
Stefan Metzmacher
550f5fb26e r17176: remove off_t from talloc. size_t is large enough to hold
the max amount of memory of one process

metze
(This used to be commit f47b7bb656)
2007-10-10 14:10:16 -05:00
Stefan Metzmacher
ec2b3baf09 r16922: move some macros out of talloc.h as the don't belong to talloc
metze
(This used to be commit 4c68e315e2)
2007-10-10 14:10:01 -05:00
Stefan Metzmacher
816c055123 r16446: talloc_set_name() allocates and can fail...
pass the error to the callers

metze
(This used to be commit 7aa07a1e0b)
2007-10-10 14:09:15 -05:00
Andrew Tridgell
a665cccd2e r15852: patch from Rusty to make talloc_set_destructor() and talloc_steal()
type safe. This only works on recent gcc versions. With other
compilers it reverts to a non-typesafe cast

The patch also ensures that talloc_free() does not change error on
systems where free() can change errno
(This used to be commit babbff5f77)
2007-10-10 14:08:32 -05:00
Andrew Tridgell
5da75f5c36 r15824: fixed a subtle talloc bug to do with memory context loops. When you
have a structure that references one of its parents, and a parent of
that parent is freed, then the whole structure should be freed, not
just the reference.

this was found by the change notify code, as a side effect of fixing
the memory leak yesterday
(This used to be commit 70531dcaee)
2007-10-10 14:08:28 -05:00
Andrew Tridgell
e4b7e8cdf1 r12633: expose talloc_vasprintf_append()
(This used to be commit 7a0e7074f6)
2007-10-10 13:49:10 -05:00
Andrew Tridgell
4476dfd3bd r11984: LGPL on header and testsuite as well
(This used to be commit ed90975bf5)
2007-10-10 13:46:55 -05:00
Simo Sorce
1702f52498 r7936: new ldb_dn_explode and ldb_dn_casefold functions and co
(This used to be commit 7ccf21ab4e)
2007-10-10 13:18:52 -05:00
Andrew Tridgell
a124028b66 r7781: finding the parent of a talloc ptr is trickier than it looks due to the two-way
tree nature of the data structure. I think I've finally got it right

also added talloc_show_parents() for debugging
(This used to be commit 5760ed20ee)
2007-10-10 13:18:36 -05:00
Andrew Tridgell
545203d915 r7778: added talloc_find_parent_bytype() and talloc_find_parent_byname()
These provide a way to find a parent of a ptr that is of a given
type. I will be using this to find the event context in smbd, relying
on the fact that everything is a child of the top level event
context. I did look at the alternatives, and found that passing the
event context to just about every call in smbd was getting way too
complex (we need to get it to anything that can do a ldb operation, as
that can invoke ldap).

So this method avoids a global, and seems to work nicely
(This used to be commit bdb55c7a10)
2007-10-10 13:18:35 -05:00
Simo Sorce
157a32956a r6645: Add talloc_get_size() function.
Sometimes it is usefull to know this data.

Simo.
(This used to be commit df40184782)
2007-10-10 13:16:32 -05:00
Andrew Tridgell
0d36266cd4 r6075: added talloc_enable_null_tracking() (asked for by lifeless)
(This used to be commit 40b8ee186a)
2007-10-10 13:11:17 -05:00
Andrew Tridgell
340d35be2d r5937: - performance improvement to talloc_asprintf_append()
- allow standalone talloc to use gcc printf attributes
(This used to be commit e25aa54e96)
2007-10-10 13:11:10 -05:00
Andrew Tridgell
7b79694ead r4790: added type checking helper macros in talloc. These take advantage of
the type names that talloc already keeps around for pointers, and
allows the user to type check void* private pointers. It can also be
used to implement polymorphism in C, as I'm sure someone would have
pointed out to me sooner or later :-)
(This used to be commit c283e1a3ef)
2007-10-10 13:08:55 -05:00
Andrew Tridgell
4b73689468 r4711: - deprecate talloc_destroy()
- expanded the talloc_realloc() test a little (I was concerned about a
  possible bug, which turned out to be an illusion)

- don't enable gcov by default in Makefile.talloc
(This used to be commit 4ec47cc108)
2007-10-10 13:08:46 -05:00
Stefan Metzmacher
90d65c2e85 r4689: - make talloc_report_depth() public
- add talloc_parent() to return the parent context of a pointer

these are very use full for debuging

metze
(This used to be commit 9b9501bc03)
2007-10-10 13:08:43 -05:00
Stefan Metzmacher
0c440d6506 r4687: use struct type and location for easier finding
metze
(This used to be commit a88aac7a39)
2007-10-10 13:08:43 -05:00
Stefan Metzmacher
1bdbd21eb2 r4609: add a usefull data_blob_dup_talloc() macro
metze
(This used to be commit 11e006df16)
2007-10-10 13:08:33 -05:00
Andrew Tridgell
11ce2cfd70 r4591: - converted the other _p talloc functions to not need _p
- added #if TALLOC_DEPRECATED around the _p functions

- fixes the code that broke from the above

while doing this I fixed quite a number of places that were
incorrectly using the non type-safe talloc functions to use the type
safe ones. Some were even doing multiplies for array allocation, which
is potentially unsafe.
(This used to be commit 6e7754abd0)
2007-10-10 13:08:30 -05:00
Andrew Tridgell
e159e42d84 r4550: talloc() is now typesafe. It is exactly equivalent to the old talloc_p() macro. Use
talloc_size() if you want the old behaviour.

I have kept talloc_p() as an alias for now. Once we change all calls
to be plain talloc() then we can remove it.
(This used to be commit 2011bbeb84)
2007-10-10 13:08:26 -05:00
Andrew Tridgell
ddc10d4d37 r4549: got rid of a lot more uses of plain talloc(), instead using
talloc_size() or talloc_array_p() where appropriate.

also fixed a memory leak in pvfs_copy_file() (failed to free a memory
context)
(This used to be commit 89b74b5354)
2007-10-10 13:08:25 -05:00
Andrew Tridgell
cc55aef7c1 r4547: - added talloc_new(ctx) macro that is a neater form of the common talloc(ctx, 0) call.
- cleaned up some talloc usage in various files

I'd like to get to the point that we have no calls to talloc(), at
which point we will rename talloc_p() to talloc(), to encourage
everyone to use the typesafe functions.
(This used to be commit e6c81d7c9f)
2007-10-10 13:08:20 -05:00
Andrew Tridgell
f4b349127b r4479: added the function talloc_autofree_context() which returns a talloc context that
will automatically be freed on program exit. This is useful for reducing
clutter in leak reports
(This used to be commit cf73dda652)
2007-10-10 13:08:10 -05:00
Andrew Tridgell
65f96eba32 r4473: - moved talloc into its own lib/talloc/ area
- added gcov flags to Makefile.talloc

- expanded talloc testsuite to add a test for realloc with a child ptr

- fixed a bug in talloc_realloc() with realloc of a ptr that has child ptrs
(This used to be commit 98b5f73c1b)
2007-10-10 13:07:55 -05:00