projects
/
userspace-rcu.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
fix: ifdef linux specific cpu count compat
[userspace-rcu.git]
/
tests
/
benchmark
/
test_urcu_hash.h
diff --git
a/tests/benchmark/test_urcu_hash.h
b/tests/benchmark/test_urcu_hash.h
index c0727b7ba9898d92d14a51c103a0f95389fa9b55..47b2ae3ea5f3523c06a5a67fb835b823ebe78fcf 100644
(file)
--- a/
tests/benchmark/test_urcu_hash.h
+++ b/
tests/benchmark/test_urcu_hash.h
@@
-23,7
+23,6
@@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
-#include "config.h"
#include <stdio.h>
#include <pthread.h>
#include <stdlib.h>
#include <stdio.h>
#include <pthread.h>
#include <stdlib.h>
@@
-32,13
+31,14
@@
#include <sys/wait.h>
#include <unistd.h>
#include <stdio.h>
#include <sys/wait.h>
#include <unistd.h>
#include <stdio.h>
-#include <assert.h>
#include <errno.h>
#include <signal.h>
#include <errno.h>
#include <signal.h>
+#include <urcu/assert.h>
#include <urcu/tls-compat.h>
#include <urcu/tls-compat.h>
-#include
"cpuset.h"
+#include
<compat-rand.h>
#include "thread-id.h"
#include "thread-id.h"
+#include "../common/debug-yield.h"
#define DEFAULT_HASH_SIZE 32
#define DEFAULT_MIN_ALLOC_SIZE 1
#define DEFAULT_HASH_SIZE 32
#define DEFAULT_MIN_ALLOC_SIZE 1
@@
-248,10
+248,11
@@
uint32_t hash_u32(
/*----------------------------------- handle the last 3 uint32_t's */
switch (length) { /* all the case statements fall through */
/*----------------------------------- handle the last 3 uint32_t's */
switch (length) { /* all the case statements fall through */
- case 3: c += k[2];
- case 2: b += k[1];
+ case 3: c += k[2];
/* fall through */
+ case 2: b += k[1];
/* fall through */
case 1: a += k[0];
final(a, b, c);
case 1: a += k[0];
final(a, b, c);
+ /* fall through */
case 0: /* case 0: nothing left to add */
break;
}
case 0: /* case 0: nothing left to add */
break;
}
@@
-284,10
+285,11
@@
void hashword2(
/*----------------------------------- handle the last 3 uint32_t's */
switch (length) { /* all the case statements fall through */
/*----------------------------------- handle the last 3 uint32_t's */
switch (length) { /* all the case statements fall through */
- case 3: c += k[2];
- case 2: b += k[1];
+ case 3: c += k[2];
/* fall through */
+ case 2: b += k[1];
/* fall through */
case 1: a += k[0];
final(a, b, c);
case 1: a += k[0];
final(a, b, c);
+ /* fall through */
case 0: /* case 0: nothing left to add */
break;
}
case 0: /* case 0: nothing left to add */
break;
}
@@
-302,7
+304,7
@@
unsigned long test_hash_mix(const void *_key, size_t length, unsigned long seed)
{
unsigned int key = (unsigned int) _key;
{
unsigned int key = (unsigned int) _key;
- assert(length == sizeof(unsigned int));
+
urcu_posix_
assert(length == sizeof(unsigned int));
return hash_u32(&key, 1, seed);
}
#else
return hash_u32(&key, 1, seed);
}
#else
@@
-318,7
+320,7
@@
unsigned long test_hash_mix(const void *_key, size_t length, unsigned long seed)
uint32_t v32[2];
} key;
uint32_t v32[2];
} key;
- assert(length == sizeof(unsigned long));
+
urcu_posix_
assert(length == sizeof(unsigned long));
v.v64 = (uint64_t) seed;
key.v64 = (uint64_t) _key;
hashword2(key.v32, 2, &v.v32[0], &v.v32[1]);
v.v64 = (uint64_t) seed;
key.v64 = (uint64_t) _key;
hashword2(key.v32, 2, &v.v32[0], &v.v32[1]);
@@
-343,7
+345,7
@@
unsigned long test_hash(const void *_key, size_t length,
} else {
unsigned long v;
} else {
unsigned long v;
- assert(length == sizeof(unsigned long));
+
urcu_posix_
assert(length == sizeof(unsigned long));
v = (unsigned long) _key;
return v % nr_hash_chains;
}
v = (unsigned long) _key;
return v % nr_hash_chains;
}
@@
-365,7
+367,7
@@
static inline
void cds_lfht_test_lookup(struct cds_lfht *ht, void *key, size_t key_len,
struct cds_lfht_iter *iter)
{
void cds_lfht_test_lookup(struct cds_lfht *ht, void *key, size_t key_len,
struct cds_lfht_iter *iter)
{
- assert(key_len == sizeof(unsigned long));
+
urcu_posix_
assert(key_len == sizeof(unsigned long));
cds_lfht_lookup(ht, test_hash(key, key_len, TEST_HASH_SEED),
test_match, key, iter);
cds_lfht_lookup(ht, test_hash(key, key_len, TEST_HASH_SEED),
test_match, key, iter);
This page took
0.025527 seconds
and
4
git commands to generate.