summaryrefslogtreecommitdiff
path: root/source4/lib/talloc/talloc.c
AgeCommit message (Collapse)AuthorFilesLines
2008-09-16Share talloc source code between Samba 3 and Samba 4.Jelmer Vernooij1-1732/+0
2008-09-14Fix warnings on SuSE 9.0.Stefan Metzmacher1-0/+8
The macros "[un]likely" are already defined on SuSE 9.0. Patch from Volker. (partialy cherry-picked 30d181c92463aecd6e649330d3645d86d5a17e43) metze (This used to be commit ad7ed33f786124e4afbba4330201a3a6463c6f73)
2008-09-14Fix bug 5400Volker Lendecke1-2/+2
Thanks to Jason Mader! Volker (cherry picked from commit 87d8a63ce4e6dd91ea3193d0a2574520a5857be2) (This used to be commit 34ab9e5a23458c9f9845d1ff808c142cb2f1f2a4)
2008-02-11Fix a c++ warningVolker Lendecke1-1/+2
(This used to be commit 9f402c607f44663cab91cc7d2139f62b84c99cc0)
2008-02-11talloc_free_children can only reset pool if it's emptyVolker Lendecke1-1/+2
(This used to be commit 5cc7a638e93e5f3540755b441a99d4fd3c9c7134)
2008-02-11Mark talloc_pool memory for valgrindVolker Lendecke1-3/+16
(This used to be commit 6deca23b6c66616fbf5ba004e9b778aa68790df6)
2008-02-11Implement talloc_pool()Volker Lendecke1-7/+169
A talloc pool is a chunk of memory that can be used as a context for further talloc calls. Allocations with the pool as the parent just chew from that memory by incrementing a pointer. If the talloc pool is full, then we fall back to the normal system-level malloc(3) to get memory. The use case for talloc pools is the transient memory that is used for handling a single SMB request. Incrementing a pointer will be way faster than any malloc implementation. There is a downside of this: If you use talloc_steal() to move something out of the pool, the whole pool memory is kept around until the last object inside the pool is freed. So if you talloc_free() the pool, it might happen that the memory is freed later. So don't hang anything off a talloc pool that should live long. Volker (This used to be commit 60ef9a84f0bd18d48e453c08aa420d17275e0881)
2008-02-11Add a comment.Michael Adam1-0/+1
Michael (This used to be commit 2a2c28584cdb65fcea8563eb3bf21fea497fdff3)
2008-02-11Fix talloctort: move size check after referenced ptr check.Michael Adam1-5/+5
Michael (This used to be commit a0caedb94f6f7c62ae706e35a4c0b2876f74978d)
2008-02-11Don't shrink a talloc area if we have less than 1k to gainVolker Lendecke1-0/+5
(This used to be commit 0c829e6ee6f43299cc5889c2af3d0402256da0d0)
2007-12-21r26514: Revert the talloc.c part of r26511, as talloc.h already takes care ↵Kai Blin1-3/+0
of thois. Thanks to metze for pointing this out (This used to be commit 4a5e1047fff0620aa534b147ac7e0bd0416a8fe7)
2007-12-21r26511: Janitorial: Fix a warning for the 'printf' attribute on gendb_search_vKai Blin1-2/+5
While at it, also add a PRINTF_ATTRIBUTE for talloc_vasprintf. (This used to be commit 5b3a8c8ae195e6a98357a407a0699493f54a8b79)
2007-10-10r25216: make talloc_append_string() a deprecated macro instead ofStefan Metzmacher1-26/+0
having it as a real function. metze (This used to be commit 2b2e8414650f4793e7fd6e7fb368383ee268948f)
2007-10-10r25211: fix compiler warningStefan Metzmacher1-0/+4
metze (This used to be commit c0d095c8c9c1f9a7a96771e20680c105f0cce308)
2007-10-10r25209: unify logic of talloc_vasprintf_append() and ↵Stefan Metzmacher1-50/+29
talloc_vasprintf_append_buffer() metze (This used to be commit 780c1c776e15f7224256a0ba0bda3e9f04702abe)
2007-10-10r25208: add talloc_str[n]dup_append[_buffer]() functionsStefan Metzmacher1-0/+96
metze (This used to be commit 8532076720ddaf3409db1196550cd7c6884380fc)
2007-10-10r25207: remove one nesting level and use unlikely()Stefan Metzmacher1-7/+7
metze (This used to be commit c2931540bc6e2d7665ef46a123f1c0618c3b55b7)
2007-10-10r25206: unify logic of talloc_strdup() and talloc_strndup(),Stefan Metzmacher1-22/+20
only strlen() vs. strnlen() is the difference now. metze (This used to be commit 92106e6b7e4ed3b6e1aa942b6dc8ae52fdf5805b)
2007-10-10r25164: Add talloc_asprintf_append_buffer() and the docs for it.Jeremy Allison1-2/+63
Jeremy. (This used to be commit 5bb8613b86a6788efde840d5b50710f9afd22fed)
2007-10-10r25116: Fix talloc_asprintf_append to do the right thing withJeremy Allison1-5/+2
truncated strings. Jeremy. (This used to be commit 948d32bb62b0e8c68cc961a380eae602ffc71870)
2007-10-10r24626: as TALLOC_ABORT() is defined to abort() by defaultStefan Metzmacher1-2/+12
wrap it into a function so that the function name in the backtrace shows what happens. metze (This used to be commit 0216ff6daa276e413811ca32cca0a66b4b2abe55)
2007-10-10r23798: updated old Temple Place FSF addresses to new URLAndrew Tridgell1-2/+1
(This used to be commit 40c0919aaa9c1b14bbaebb95ecce53eb0380fdbb)
2007-10-10r23795: more v2->v3 conversionAndrew Tridgell1-1/+1
(This used to be commit 84b468b2f8f2dffda89593f816e8bc6a8b6d42ac)
2007-10-10r22758: - add missing _talloc_set_name_const(ret, ret); to ↵Stefan Metzmacher1-0/+2
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-10r22563: As tridge requested remove the _strict calls - for Samba3 I'm movingJeremy Allison1-89/+0
to a separate file. Jeremy. (This used to be commit 80706cf98d31593a899652acb2cdedaa8bf3dfab)
2007-10-10r22539: Added _strict varients of the talloc calls toJeremy Allison1-0/+87
return NULL on size == 0 varients. Jeremy. (This used to be commit 1ef269067ca501e2a4ded4ca8654c6a6cc26f385)
2007-10-10r21174: many thanks to Paul Wayper for pointing out that C99 requires aAndrew Tridgell1-6/+11
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-10r20195: fix typoStefan Metzmacher1-1/+1
metze (This used to be commit 9d06a4b6e22e18bdaa4383c7b9ab8af058c157c0)
2007-10-10r20194: inline all static talloc functionsStefan Metzmacher1-4/+6
metze (This used to be commit ee47b404412299ac0e341f0d269adc21a7ebc603)
2007-10-10r20193: - let talloc_parent_chunk() handle a NULL pointerStefan Metzmacher1-15/+11
- use talloc_parent_chunk() in talloc_parent_name() - add prototype of talloc_parent_name() metze (This used to be commit 85fc18f047cd2132d0c455f739ee76ce5005d7ed)
2007-10-10r19412: some rather strange looking changes to talloc that gain us about 50%Andrew Tridgell1-211/+299
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-10r19304: If you really want to look at the contents undef this oneSimo Sorce1-0/+17
(This used to be commit fe20ac404d654abe31729664584391f3b3cd0214)
2007-10-10r18995: - fix bug 4078Stefan Metzmacher1-6/+12
- 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-10r18946: fix compiler warningStefan Metzmacher1-1/+1
metze (This used to be commit 450595822441ebaa199d6b10d568274940b1a91b)
2007-10-10r18521: implement volkers suggestion for avoiding the type punning warningsAndrew Tridgell1-1/+2
(This used to be commit 9b9f058edb033c999c4430add4f05459ac43c9e2)
2007-10-10r18435: added a function talloc_move() which is like talloc_steal(), but isAndrew Tridgell1-0/+11
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-10r18129: moved the system includes into libreplace - this gives much moreAndrew Tridgell1-17/+0
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-10r18100: actually make usage of libreplace :-)Stefan Metzmacher1-1/+1
metze (This used to be commit 357882e6ec20b559b7053a8dffb72b7dec26b82f)
2007-10-10r18027: Fix some 64-bit warningsVolker Lendecke1-1/+1
(This used to be commit cd495d89314a653b5976b1690e075fd7bac2f59b)
2007-10-10r17950: sync talloc with samba3Stefan Metzmacher1-0/+7
metze (This used to be commit 5697841e2949d2f7a053b4766c48906943a5a04e)
2007-10-10r17907: - add a generic talloc_report_depth_cb() function which takes a callbackStefan Metzmacher1-49/+80
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-10r17895: - talloc_increase_ref_count() can failStefan Metzmacher1-3/+6
- make talloc_reference() typesafe when gcc >= 3 is used metze (This used to be commit 933d1b47ad614d02cc02b602e704948b342febdb)
2007-10-10r17893: add a function to disable the null_contextStefan Metzmacher1-2/+10
metze (This used to be commit 7cab4285b1b61ad5cb425e42d89bcf7d645b0710)
2007-10-10r17892: fix the last talloc c++ warningStefan Metzmacher1-1/+2
metze (This used to be commit 6955ffe4544eddd9e34461f57858480b1acf49c9)
2007-10-10r17891: remove c++ warnings from tallocStefan Metzmacher1-11/+12
metze (This used to be commit fb73ce8d4364a1da3c320034d90c0556529c61c4)
2007-10-10r17578: in standalone talloc build ensure we get intptr_t if available (whichAndrew Tridgell1-0/+3
makes the discard_const stuff nicer) (This used to be commit 662f01f8ba861a5ef1d5ee724ed2b3ab9812597a)
2007-10-10r17264: - remove unused includes from tallocStefan Metzmacher1-14/+4
- 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-10r17176: remove off_t from talloc. size_t is large enough to holdStefan Metzmacher1-5/+5
the max amount of memory of one process metze (This used to be commit f47b7bb656c8854c16c5a28ba24d18eeb22b6e22)
2007-10-10r17062: make correct use of talloc destructors, and make the code much simplerStefan Metzmacher1-14/+12
should I merge that aslo to samba3? metze (This used to be commit c5672a54a02e3f457effd7cc693a6f6ac2dcc621)
2007-10-10r17061: - remove the currect talloc chunk from it's parent before freeing ↵Stefan Metzmacher1-5/+3
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)