Age | Commit message (Collapse) | Author | Files | Lines |
|
Also general cleanups:
(1) Don't assume that strings are folded by the compiler.
(2) Implement likely_stats_reset().
(3) Return non-const string from likely_stats(), as caller must free it.
(4) Don't use struct info indirection (that was from when we used callbacks?)
(5) Close memory leak in run-debug.c
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
(Imported from CCAN commit 0e5d0e30b30bb07b6605843e5ff224210d8083d8)
|
|
Unfortunately it's a bit of a pain to use for typed hashtables, but it
works.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
(Imported from CCAN commit 60cc720d0797fc49325437ea36a9ffd909c75ed0)
|
|
We change from htable_new()/htable_free() to htable_init/htable_clear.
We also change HTABLE_DEFINE_TYPE() to be the full name, without automatically
prepending htable_.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
(Imported from CCAN commit 0c3590dc33d644f73bb8587db454c491830aaf26)
|
|
There's no real reason to start with 128 entries.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
(Imported from CCAN commit 45f24da35118db441e6153f02f6ddd937da1fa1c)
|
|
This lets us compare hash table vs. strset vs. the example
implementation of critbit trees.
cbspeed 100 runs, min-max(avg):
#01: Initial insert: 236-245(237)
#02: Initial lookup (match): 180-186(180)
#03: Initial lookup (miss): 171-185(172)
#04: Initial lookup (random): 441-457(444)
#05: Initial delete all: 127-132(128)
#06: Initial re-inserting: 219-225(220)
#07: Deleting first half: 101-104(102)
#08: Adding (a different) half: 158-162(159)
#09: Lookup after half-change (match): 202-207(203)
#10: Lookup after half-change (miss): 217-222(218)
#11: Churn 1: 297-302(299)
#12: Churn 2: 297-305(300)
#13: Churn 3: 301-308(303)
#14: Post-Churn lookup (match): 189-195(190)
#15: Post-Churn lookup (miss): 189-193(190)
#16: Post-Churn lookup (random): 499-513(503)
speed 100 runs, min-max(avg):
#01: Initial insert: 211-218(212)
#02: Initial lookup (match): 161-166(162)
#03: Initial lookup (miss): 157-162(158)
#04: Initial lookup (random): 452-460(454)
#05: Initial delete all: 126-135(127)
#06: Initial re-inserting: 193-201(194)
#07: Deleting first half: 99-107(99)
#08: Adding (a different) half: 143-190(144)
#09: Lookup after half-change (match): 183-195(184)
#10: Lookup after half-change (miss): 197-203(198)
#11: Churn 1: 271-278(274)
#12: Churn 2: 280-287(282)
#13: Churn 3: 277-285(279)
#14: Post-Churn lookup (match): 171-175(171)
#15: Post-Churn lookup (miss): 174-178(175)
#16: Post-Churn lookup (random): 525-552(528)
stringspeed 100 runs, min-max(avg):
#01: Initial insert: 300-343(308)
#02: Initial lookup (match): 98-136(99)
#03: Initial lookup (miss): 73-102(75)
#04: Initial lookup (random): 230-282(233)
#05: Initial delete all: 66-102(69)
#06: Initial re-inserting: 62-99(64)
#07: Deleting first half: 43-52(43)
#08: Adding (a different) half: 101-156(106)
#09: Lookup after half-change (match): 114-156(120)
#10: Lookup after half-change (miss): 94-103(95)
#11: Churn 1: 98-105(99)
#12: Churn 2: 96-104(98)
#13: Churn 3: 174-184(176)
#14: Post-Churn lookup (match): 93-112(94)
#15: Post-Churn lookup (miss): 77-107(79)
#16: Post-Churn lookup (random): 229-265(232)
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
(Imported from CCAN commit 5c559e7df1d31b4c0ddf26451fac972dc8a0c2c9)
|
|
Firstly, -Wwrite-strings makes string literals const, secondly, we mustn't
define str_strstr etc in terms of themselves!
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
(Imported from CCAN commit 0845e79650c9257aa0ddef8ff99fd815b5edffac)
|
|
LGPL is overkill for trivial wrappers like this.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
(Imported from CCAN commit 942f2788e165bb203b0f160f29bd4592f32dc344)
|
|
documentation.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
(Imported from CCAN commit 12652625db55f6586e95fc5edc73e1e85bae8a5c)
|
|
As pointed out by Christian Thaeter, it has bitrotted.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
(Imported from CCAN commit f725bbb1987284933e0f21dfb8f2ce7a1f0806e5)
|
|
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
(Imported from CCAN commit d3d4303acd139e8c34f11067333c000a3f885307)
|
|
It's just a header, I don't care what's done with it.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
(Imported from CCAN commit d06b67d244657da7054e3da580a771c365566d3c)
|
|
We weren't testing for this, and without it, typesafe_cb just casts
its function argument. This is why I didn't get a warning when one of
my patches amended a function incorrectly.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
|
|
When we do --enable-tdb2, we start clashing with the replace.h
version:
In file included from ../lib/tdb2/tools/../private.h:25:0,
from ../lib/tdb2/tools/tdb2torture.c:60:
../lib/ccan/likely/likely.h:32:0: warning: "likely" redefined
../lib/replace/replace.h:762:0: note: this is the location of the previous definition
../lib/ccan/likely/likely.h:53:0: warning: "unlikely" redefined
../lib/replace/replace.h:765:0: note: this is the location of the previous definition
I don't like to #ifndef-protect them in general, since you don't want
different parts of the code to silently have different definitions,
but it's the simplest fix for now.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
|
|
Autobuild-User: Volker Lendecke <vlendec@samba.org>
Autobuild-Date: Wed Aug 10 21:12:59 CEST 2011 on sn-devel-104
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
This imports licensing clarifications and updates as discussed on
samba-technical ("Subject: Re: ccan code breaks older build farm
systems").
In particular, the recent version have per-file license markers, and
some modules are relicenced more liberally: in particular Simo pointed
out that htable was GPL, and indirectly included by libtdb2, which
would have made that GPL as well.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Autobuild-User: Rusty Russell <rusty@rustcorp.com.au>
Autobuild-Date: Mon Jul 25 12:03:40 CEST 2011 on sn-devel-104
|
|
README points out that these code snippets have their own licenses,
and that their home is elsewhere.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
|
|
Michael Adam points out this broke the build farm (ie. OSF1 axp V5.1 2650 alpha)
so fixed in CCAN and imported from af7a902d74a7926693f55da9e21a67dde46931d4:
Turns out it's not standard (thanks Samba build farm!)
And the previous test had a hole in it anyway. This one is more conservative.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Autobuild-User: Rusty Russell <rusty@rustcorp.com.au>
Autobuild-Date: Wed Jul 6 08:34:05 CEST 2011 on sn-devel-104
|
|
It's not enough to compile-test them: Michael Adam points out that nonexistant
functions merely cause a warning. We have to try to link them.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Autobuild-User: Rusty Russell <rusty@rustcorp.com.au>
Autobuild-Date: Tue Jul 5 07:08:55 CEST 2011 on sn-devel-104
|
|
Based on commit 0284423676209380a2e07086b9b356096a2f93e6 from CCAN:
Author: Rusty Russell <rusty@rustcorp.com.au>
Date: Tue Jun 21 10:43:31 2011 +0930
tally: fix FreeBSD compile, memleak in tests.
Posix says ssize_t is in sys/types.h; on Linux stdlib.h is enough.
Autobuild-User: Rusty Russell <rusty@rustcorp.com.au>
Autobuild-Date: Tue Jun 21 05:52:12 CEST 2011 on sn-devel-104
|
|
Imported from git://git.ozlabs.org/~ccan/ccan init-1161-g661d41f
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
|