1
0
mirror of https://github.com/samba-team/samba.git synced 2025-11-22 16:23:49 +03:00
Commit Graph

47 Commits

Author SHA1 Message Date
Stefan Metzmacher
b091d182fe r17264: - remove unused includes from talloc
- check explicit check for varargs.h as fallback from stdarg.h
  and fail the build if both are not present

metze
2007-10-10 14:10:25 -05:00
Stefan Metzmacher
f47b7bb656 r17176: remove off_t from talloc. size_t is large enough to hold
the max amount of memory of one process

metze
2007-10-10 14:10:16 -05:00
Stefan Metzmacher
c5672a54a0 r17062: make correct use of talloc destructors, and make the code much simpler
should I merge that aslo to samba3?

metze
2007-10-10 14:10:10 -05:00
Stefan Metzmacher
0559222b62 r17061: - remove the currect talloc chunk from it's parent before freeing the children
this fixes an endless loop bug!
- reenable the test for this

should I merge this to samba3?

metze
2007-10-10 14:10:09 -05:00
Stefan Metzmacher
7aa07a1e0b r16446: talloc_set_name() allocates and can fail...
pass the error to the callers

metze
2007-10-10 14:09:15 -05:00
Andrew Tridgell
bba33a976b r15856: fixed talloc_asprintf_append() on solaris 2007-10-10 14:08:33 -05:00
Andrew Tridgell
babbff5f77 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
2007-10-10 14:08:32 -05:00
Andrew Tridgell
e00ff9f35e r15828: a talloc steal optimisation spotted by metze 2007-10-10 14:08:29 -05:00
Andrew Tridgell
70531dcaee 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
2007-10-10 14:08:28 -05:00
Jelmer Vernooij
a5c87360a7 r14999: Remove more unused autoconf code
Simplify va_copy() replacement code a bit
2007-10-10 14:04:00 -05:00
Andrew Tridgell
bc45451ddd r14288: - make the snprintf call in talloc portable to older solaris boxes
- fixed an error found sing the beam analyser
2007-10-10 13:57:08 -05:00
Volker Lendecke
4d0aa6f525 r14131: Fix Coverity bug # 127 2007-10-10 13:56:53 -05:00
James Peach
1ab4674196 r13400: Only return NULL from talloc_asprintf if vsnprintf returns an
error (ie. zero is not an error).
2007-10-10 13:51:52 -05:00
James Peach
23782f899a r13397: Propagate the error return from vsnprintf to trap the case where
we aren't linked against a C99 vsnprintf.
2007-10-10 13:51:52 -05:00
Andrew Tridgell
7a0e7074f6 r12633: expose talloc_vasprintf_append() 2007-10-10 13:49:10 -05:00
Andrew Tridgell
5bdd50fa38 r11983: make talloc LGPL. This makes more sense given that ldb depends on
talloc, and ldb is now LGPL
2007-10-10 13:46:54 -05:00
Andrew Tridgell
f31a2376f3 r10726: fix to talloc_parent() from Michael O'Brien 2007-10-10 13:39:25 -05:00
Andrew Tridgell
46632e2048 r8127: fixed code in function error 2007-10-10 13:19:12 -05:00
Andrew Tridgell
689a9ccf91 r8126: - moved to 16 byte alignment for talloc. This is in response to a bug
report from robert collins.

- updated talloc guide to reflect the fact that over the last few
  months talloc overhead compared to malloc has dropped, probably due
  to a bunch of small changes. It now costs about 4% more than malloc
  on my box
2007-10-10 13:19:12 -05:00
Andrew Tridgell
563058e78b r8032: added loop detection into talloc. Robert Collins found a way to make a
memory loop with talloc_unlink(), so now we detect it and handle it
2007-10-10 13:19:00 -05:00
Simo Sorce
7ccf21ab4e r7936: new ldb_dn_explode and ldb_dn_casefold functions and co 2007-10-10 13:18:52 -05:00
Andrew Tridgell
5760ed20ee 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
2007-10-10 13:18:36 -05:00
Andrew Tridgell
ee3fe42fb1 r7780: fixed a bug in talloc_find_parent_byname() 2007-10-10 13:18:35 -05:00
Andrew Tridgell
bdb55c7a10 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
2007-10-10 13:18:35 -05:00
Andrew Tridgell
257027a571 r6845: make the talloc header align to 40 bytes, which costs us an extra 4
bytes per allocation, but makes it much more portable
2007-10-10 13:16:50 -05:00
Andrew Tridgell
aac86583a9 r6831: talloc now requires config.h (this fixes ldb build) 2007-10-10 13:16:49 -05:00
Jelmer Vernooij
f46c532883 r6828: More portability fixes 2007-10-10 13:16:48 -05:00
Andrew Tridgell
450ac2e4de r6812: more talloc portability tweaks 2007-10-10 13:16:46 -05:00
Andrew Tridgell
c8a274c873 r6808: - test for gcov not needed
- samba malloc wrapper avoidance not needed now we don't use includes.h

- make testsuite work when BOOL, True, False already defined
2007-10-10 13:16:46 -05:00
Jelmer Vernooij
c2ce09d380 r6804: Add config.h for talloc (and use it) 2007-10-10 13:16:45 -05:00
Andrew Tridgell
7af0c547e0 r6741: prevent talloc_strndup() from reading one byte past the end of a buffer,
giving valgrind errors
2007-10-10 13:16:40 -05:00
Volker Lendecke
777c489cad r6660: Sorry for the spam... I think now I've got a version that should compile on
trunk, 3_0 and 4_0.

Volker
2007-10-10 13:16:32 -05:00
Simo Sorce
34671674ee r6650: keep style consistent 2007-10-10 13:16:32 -05:00
Simo Sorce
df40184782 r6645: Add talloc_get_size() function.
Sometimes it is usefull to know this data.

Simo.
2007-10-10 13:16:32 -05:00
Volker Lendecke
9fa26d2c97 r6513: Commit talloc_free_children.
Volker
2007-10-10 13:16:21 -05:00
Andrew Tridgell
40b8ee186a r6075: added talloc_enable_null_tracking() (asked for by lifeless) 2007-10-10 13:11:17 -05:00
Andrew Bartlett
48c5187967 r6033: Patch from 'lifeless' to clarify behaviour with NULL pointers.
Andrew Bartlett
2007-10-10 13:11:16 -05:00
Andrew Tridgell
3060b26c9e r5938: - allow NULL string argument to talloc_vasprintf_append()
- default to using va_copy(), thus assuming a modern libc
2007-10-10 13:11:10 -05:00
Andrew Tridgell
e25aa54e96 r5937: - performance improvement to talloc_asprintf_append()
- allow standalone talloc to use gcc printf attributes
2007-10-10 13:11:10 -05:00
Andrew Tridgell
e73e49aaa6 r5119: fflush after talloc reports to ensure they are fully on disk when using tee 2007-10-10 13:09:24 -05:00
Andrew Tridgell
c283e1a3ef 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 :-)
2007-10-10 13:08:55 -05:00
Andrew Tridgell
603ef69be0 r4718: don't use the deprecated __va_copy() unless va_copy() is unavailable 2007-10-10 13:08:47 -05:00
Stefan Metzmacher
9b9501bc03 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
2007-10-10 13:08:43 -05:00
Andrew Tridgell
6e7754abd0 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.
2007-10-10 13:08:30 -05:00
Andrew Tridgell
2011bbeb84 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.
2007-10-10 13:08:26 -05:00
Andrew Tridgell
cf73dda652 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
2007-10-10 13:08:10 -05:00
Andrew Tridgell
98b5f73c1b 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
2007-10-10 13:07:55 -05:00