summaryrefslogtreecommitdiff
path: root/source4/torture/local/talloc.c
AgeCommit message (Collapse)AuthorFilesLines
2007-10-10r2799: removed one last occurance of torture_ldb_alloc()Andrew Tridgell1-3/+3
(This used to be commit 5045482b14dfcbb535eab3e5fa63ef1c3b46c40f)
2007-10-10r2791: got rid of talloc_unreference() and instead created talloc_unlink(),Andrew Tridgell1-21/+109
which is much clearer and simpler to use. It removes a specific parent from a pointer, no matter whether that parent is a "reference" or a direct parent. This gives complete control over the free process. (This used to be commit 6c563887f1b9b8c842309a523e88b6f2a32db10f)
2007-10-10r2744: ben elliston taught me about gcov today, which allows you to measureAndrew Tridgell1-20/+300
the % coverage in terms of lines of code of a test suite. I thought a good first place to start with gcov was the talloc test suite. When I started the test suite covered about 60% of all lines of code in talloc.c, and now it covers about 99%. The only lines not covered are talloc corruption errors, as that would cause smb_panic() to fire. It will be interesting to try gcov on the main Samba test suite for smbd. We won't achieve 100% coverage, but it would be nice to get to 90% or more. I also modified the talloc.c sources to be able to be build standalone, using: gcc -c -D_STANDALONE_ -Iinlcude lib/talloc.c that should make it much easier to re-use talloc in other projects (This used to be commit 8d4dc99b82efdf24b6811851c7bdd4af5a4c52c9)
2007-10-10r2742: - fixed a bug in talloc_unreference()Andrew Tridgell1-41/+113
- made the LOCAL-TALLOC smbtorture test much stricter, checking that block counts for every pointer are correct after every operation (This used to be commit 18d3e2647f0bedbba699d1ba2649c0cfe4526ef6)
2007-10-10r2718: - added a talloc_unreference() function as requested by metze.Andrew Tridgell1-17/+121
- added documentation for talloc_unreference() - made the abandoned child logic in talloc_free() clearer and more consistent (This used to be commit a87584c8e3fb06cd3ff29a918f681b5c6c32b9ff)
2007-10-10r2711: added a simple talloc speed tester. I get the following on my laptop:Andrew Tridgell1-0/+55
MEASURING TALLOC VS MALLOC SPEED talloc: 279154 ops/sec malloc: 318758 ops/sec which I think is an acceptable overhead for the increased functionality (This used to be commit 91669ea830c16db2730c5e43a7cad26d9db5c585)
2007-10-10r2709: finally solved the talloc reference problem.Andrew Tridgell1-0/+115
The problem was that the simple "uint_t ref_count;" in a talloc chunk did not give enough information. It told us that a pointer was referenced more than once, but it didn't say who it was referenced by. This means that when the pointer was freed we had no sane way to clean up the reference. I have now replaced ref_count with a "refs" list, which means that references point to the pointer, and the pointer has a linked list of references. So now we can cleanup from either direction without losing track of anything. I've also added a LOCAL-TALLOC smbtorture test that tests talloc behaviour for some common uses. (This used to be commit 911a8d590cb184bcb892810729955c2c4cf02550)