1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-20 14:03:59 +03:00

71 Commits

Author SHA1 Message Date
Andrew Tridgell
b8d69a7ea2 r23795: more v2->v3 conversion
(This used to be commit 84b468b2f8f2dffda89593f816e8bc6a8b6d42ac)
2007-10-10 14:59:14 -05:00
Stefan Metzmacher
7ef755d150 r22758: - add missing _talloc_set_name_const(ret, ret); to talloc_append_string()
- update manpage and add comments about _talloc_set_name_const(ret, ret);
  in all places which use them

metze
(This used to be commit 5cd100de829b75b83e49bd572a33a267cf86f215)
2007-10-10 14:52:15 -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 80706cf98d31593a899652acb2cdedaa8bf3dfab)
2007-10-10 14:51:44 -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 1ef269067ca501e2a4ded4ca8654c6a6cc26f385)
2007-10-10 14:51:39 -05:00
Andrew Tridgell
8538af1107 r21174: many thanks to Paul Wayper for pointing out that C99 requires a
matching va_end() for each va_copy(). This doesn't matter for most
architectures, but there could be some obscure ones where it does
matter.

some of this should be ported to Samba3
(This used to be commit 21eb316473486cb6b73bb3ff9c5f3a44ecd57e4a)
2007-10-10 14:44:42 -05:00
Stefan Metzmacher
90d106de8a r20195: fix typo
metze
(This used to be commit 9d06a4b6e22e18bdaa4383c7b9ab8af058c157c0)
2007-10-10 14:29:21 -05:00
Stefan Metzmacher
0d2bedbdd7 r20194: inline all static talloc functions
metze
(This used to be commit ee47b404412299ac0e341f0d269adc21a7ebc603)
2007-10-10 14:29:21 -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 85fc18f047cd2132d0c455f739ee76ce5005d7ed)
2007-10-10 14:29:21 -05:00
Andrew Tridgell
5370afe8c2 r19412: some rather strange looking changes to talloc that gain us about 50%
in the talloc benchmark. These changes were driven by some cachegrind
profiles, with the biggest improvements coming from inlining some
functions.

I don't think it would be a good idea to start spreading inline and
likely()/unlikely() in other parts of Samba, as the benefit in most
code will be very small, but talloc() is such a speed critical part of
Samba that I think these changes are worthwhile
(This used to be commit 8644708c3f42d249b5d1fd2bde37aeb35288da13)
2007-10-10 14:21:29 -05:00
Simo Sorce
666a72e39a r19304: If you really want to look at the contents undef this one
(This used to be commit fe20ac404d654abe31729664584391f3b3cd0214)
2007-10-10 14:21:05 -05:00
Stefan Metzmacher
4ccdd53704 r18995: - fix bug 4078
- talloc_free(talloc_autofree_context()); should not result
  in a SIGABORT on exit
- add a test for this, but this test can also pass in the standalone build
  and samba3, as samba4 uses talloc_autofree_context()

metze
(This used to be commit 2be48c1b033dceb9517826054b8ea97df2c94472)
2007-10-10 14:20:27 -05:00
Stefan Metzmacher
ee97148354 r18946: fix compiler warning
metze
(This used to be commit 450595822441ebaa199d6b10d568274940b1a91b)
2007-10-10 14:20:23 -05:00
Andrew Tridgell
c902a8927c r18521: implement volkers suggestion for avoiding the type punning warnings
(This used to be commit 9b9f058edb033c999c4430add4f05459ac43c9e2)
2007-10-10 14:18:41 -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 200756017e1867faa207703eddc00a75ae4527df)
2007-10-10 14:18:29 -05:00
Andrew Tridgell
a983b06d37 r18129: moved the system includes into libreplace - this gives much more
isolation of our portability environment from the main code, and also
simplifies the includes system (no separate #ifdef _SAMBA_BUILD for
tdb. ldb etc now)
(This used to be commit 77d1a468e06290aba789e2f3affc769fc5159a21)
2007-10-10 14:17:36 -05:00
Stefan Metzmacher
3c6ce57101 r18100: actually make usage of libreplace :-)
metze
(This used to be commit 357882e6ec20b559b7053a8dffb72b7dec26b82f)
2007-10-10 14:17:16 -05:00
Volker Lendecke
f6f4d868ea r18027: Fix some 64-bit warnings
(This used to be commit cd495d89314a653b5976b1690e075fd7bac2f59b)
2007-10-10 14:17:04 -05:00
Stefan Metzmacher
4ce057c3f4 r17950: sync talloc with samba3
metze
(This used to be commit 5697841e2949d2f7a053b4766c48906943a5a04e)
2007-10-10 14:16:56 -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 b199557b358e6216d89d233513079fcd56b307aa)
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 933d1b47ad614d02cc02b602e704948b342febdb)
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 7cab4285b1b61ad5cb425e42d89bcf7d645b0710)
2007-10-10 14:16:52 -05:00
Stefan Metzmacher
98a1bd7fb3 r17892: fix the last talloc c++ warning
metze
(This used to be commit 6955ffe4544eddd9e34461f57858480b1acf49c9)
2007-10-10 14:16:52 -05:00
Stefan Metzmacher
45b8c41038 r17891: remove c++ warnings from talloc
metze
(This used to be commit fb73ce8d4364a1da3c320034d90c0556529c61c4)
2007-10-10 14:16:52 -05:00
Andrew Tridgell
c0e60d0535 r17578: in standalone talloc build ensure we get intptr_t if available (which
makes the discard_const stuff nicer)
(This used to be commit 662f01f8ba861a5ef1d5ee724ed2b3ab9812597a)
2007-10-10 14:15:38 -05:00
Stefan Metzmacher
da9723c224 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
(This used to be commit b091d182fe8f36dfb67b7ede933a963b74034d91)
2007-10-10 14:10:25 -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 f47b7bb656c8854c16c5a28ba24d18eeb22b6e22)
2007-10-10 14:10:16 -05:00
Stefan Metzmacher
4e4e698f2b r17062: make correct use of talloc destructors, and make the code much simpler
should I merge that aslo to samba3?

metze
(This used to be commit c5672a54a02e3f457effd7cc693a6f6ac2dcc621)
2007-10-10 14:10:10 -05:00
Stefan Metzmacher
cab68a413b 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
(This used to be commit 0559222b62930765519aaab5d33609ece29014d6)
2007-10-10 14:10:09 -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 7aa07a1e0b2abd1a6ecd490410685d20c0201094)
2007-10-10 14:09:15 -05:00
Andrew Tridgell
d5e3f86ece r15856: fixed talloc_asprintf_append() on solaris
(This used to be commit bba33a976b1954b5e9e557c9323afc92616439a3)
2007-10-10 14:08:33 -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 babbff5f777642f559747f6d0697bc7c3a5e798d)
2007-10-10 14:08:32 -05:00
Andrew Tridgell
0db0de6190 r15828: a talloc steal optimisation spotted by metze
(This used to be commit e00ff9f35eed28aeecdc779cee06b87c34d82124)
2007-10-10 14:08:29 -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 70531dcaeeb9314d410baa0d285df6a265311541)
2007-10-10 14:08:28 -05:00
Jelmer Vernooij
4a61e4901e r14999: Remove more unused autoconf code
Simplify va_copy() replacement code a bit
(This used to be commit a5c87360a7f14a90b831ea372277f4f89ee4c5f1)
2007-10-10 14:04:00 -05:00
Andrew Tridgell
335d07d811 r14288: - make the snprintf call in talloc portable to older solaris boxes
- fixed an error found sing the beam analyser
(This used to be commit bc45451ddd6eceb9bf1ca02f84932759d99a1744)
2007-10-10 13:57:08 -05:00
Volker Lendecke
640509e6a7 r14131: Fix Coverity bug # 127
(This used to be commit 4d0aa6f525c4756ca6942439468b484e3ca4b2fa)
2007-10-10 13:56:53 -05:00
James Peach
b56dab83a4 r13400: Only return NULL from talloc_asprintf if vsnprintf returns an
error (ie. zero is not an error).
(This used to be commit 1ab4674196b9df0b2b7b6eb4991358cc2f86c0d9)
2007-10-10 13:51:52 -05:00
James Peach
f9f55ad5fc r13397: Propagate the error return from vsnprintf to trap the case where
we aren't linked against a C99 vsnprintf.
(This used to be commit 23782f899aaa5fe488d86d5e67e91be99ff7a146)
2007-10-10 13:51:52 -05:00
Andrew Tridgell
e4b7e8cdf1 r12633: expose talloc_vasprintf_append()
(This used to be commit 7a0e7074f6d3d38ce92f2b617549d5dbbaf968ef)
2007-10-10 13:49:10 -05:00
Andrew Tridgell
51a8581dea r11983: make talloc LGPL. This makes more sense given that ldb depends on
talloc, and ldb is now LGPL
(This used to be commit 5bdd50fa38b1be28cf7bcddc561c743437e70cae)
2007-10-10 13:46:54 -05:00
Andrew Tridgell
7838e13e91 r10726: fix to talloc_parent() from Michael O'Brien
(This used to be commit f31a2376f3fef1cc2b40b37fb4d94a4b67eec6d4)
2007-10-10 13:39:25 -05:00
Andrew Tridgell
ab65303fe8 r8127: fixed code in function error
(This used to be commit 46632e2048f0b87de351cd3f26229cfc4b3384ca)
2007-10-10 13:19:12 -05:00
Andrew Tridgell
b9e8935188 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
(This used to be commit 689a9ccf91f9de560a500787d85321abe096b948)
2007-10-10 13:19:12 -05:00
Andrew Tridgell
9cfe2d83f1 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
(This used to be commit 563058e78b8c74e821fabf6a43fa861c1ad09944)
2007-10-10 13:19:00 -05:00
Simo Sorce
1702f52498 r7936: new ldb_dn_explode and ldb_dn_casefold functions and co
(This used to be commit 7ccf21ab4eeb9821e457308a239f2103a106fb12)
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 5760ed20eed509b0b6e09e78c942dd0f70350fa9)
2007-10-10 13:18:36 -05:00
Andrew Tridgell
bb8d0c76b4 r7780: fixed a bug in talloc_find_parent_byname()
(This used to be commit ee3fe42fb16821eedd564201d953042190f7826f)
2007-10-10 13:18:35 -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 bdb55c7a10a516b75652065e14f5acd09d24ab35)
2007-10-10 13:18:35 -05:00
Andrew Tridgell
57bbd16b41 r6845: make the talloc header align to 40 bytes, which costs us an extra 4
bytes per allocation, but makes it much more portable
(This used to be commit 257027a571da254c16b0b456cb1cbec284d7fda0)
2007-10-10 13:16:50 -05:00
Andrew Tridgell
2cb07b0f1b r6831: talloc now requires config.h (this fixes ldb build)
(This used to be commit aac86583a9bff7d882ed56633126a1d9f27eea6a)
2007-10-10 13:16:49 -05:00