return BitReverseTable256[v];
}
-static __attribute__((unused))
+#if (CAA_BITS_PER_LONG == 32)
+static
uint32_t bit_reverse_u32(uint32_t v)
{
return ((uint32_t) bit_reverse_u8(v) << 24) |
((uint32_t) bit_reverse_u8(v >> 16) << 8) |
((uint32_t) bit_reverse_u8(v >> 24));
}
-
-static __attribute__((unused))
+#else
+static
uint64_t bit_reverse_u64(uint64_t v)
{
return ((uint64_t) bit_reverse_u8(v) << 56) |
((uint64_t) bit_reverse_u8(v >> 48) << 8) |
((uint64_t) bit_reverse_u8(v >> 56));
}
+#endif
static
unsigned long bit_reverse_ulong(unsigned long v)
static
void alloc_split_items_count(struct cds_lfht *ht)
{
- struct ht_items_count *count;
-
if (nr_cpus_mask == -1) {
ht_init_nr_cpus_mask();
if (nr_cpus_mask < 0)
assert(split_count_mask >= 0);
if (ht->flags & CDS_LFHT_ACCOUNTING) {
- ht->split_count = calloc(split_count_mask + 1, sizeof(*count));
+ ht->split_count = calloc(split_count_mask + 1,
+ sizeof(struct ht_items_count));
assert(ht->split_count);
} else {
ht->split_count = NULL;
int cds_lfht_del(struct cds_lfht *ht, struct cds_lfht_node *node)
{
- unsigned long size, hash;
+ unsigned long size;
int ret;
size = rcu_dereference(ht->size);
ret = _cds_lfht_del(ht, size, node);
if (!ret) {
+ unsigned long hash;
+
hash = bit_reverse_ulong(node->reverse_hash);
ht_count_del(ht, size, hash);
}
static void set_affinity(void)
{
+#if HAVE_SCHED_SETAFFINITY
cpu_set_t mask;
- int cpu;
- int ret;
+ int cpu, ret;
+#endif /* HAVE_SCHED_SETAFFINITY */
if (!use_affinity)
return;
static void set_affinity(void)
{
+#if HAVE_SCHED_SETAFFINITY
cpu_set_t mask;
- int cpu;
- int ret;
+ int cpu, ret;
+#endif /* HAVE_SCHED_SETAFFINITY */
if (!use_affinity)
return;
static void set_affinity(void)
{
+#if HAVE_SCHED_SETAFFINITY
cpu_set_t mask;
- int cpu;
- int ret;
+ int cpu, ret;
+#endif /* HAVE_SCHED_SETAFFINITY */
if (!use_affinity)
return;
#include <urcu/uatomic.h>
struct testvals {
+#ifdef UATOMIC_HAS_ATOMIC_BYTE
unsigned char c;
+#endif
+#ifdef UATOMIC_HAS_ATOMIC_SHORT
unsigned short s;
+#endif
unsigned int i;
unsigned long l;
};
static void set_affinity(void)
{
+#if HAVE_SCHED_SETAFFINITY
cpu_set_t mask;
- int cpu;
- int ret;
+ int cpu, ret;
+#endif /* HAVE_SCHED_SETAFFINITY */
if (!use_affinity)
return;
static void set_affinity(void)
{
+#if HAVE_SCHED_SETAFFINITY
cpu_set_t mask;
- int cpu;
- int ret;
+ int cpu, ret;
+#endif /* HAVE_SCHED_SETAFFINITY */
if (!use_affinity)
return;
static void set_affinity(void)
{
+#if HAVE_SCHED_SETAFFINITY
cpu_set_t mask;
- int cpu;
- int ret;
+ int cpu, ret;
+#endif /* HAVE_SCHED_SETAFFINITY */
if (!use_affinity)
return;
static void set_affinity(void)
{
+#if HAVE_SCHED_SETAFFINITY
cpu_set_t mask;
- int cpu;
- int ret;
+ int cpu, ret;
+#endif /* HAVE_SCHED_SETAFFINITY */
if (!use_affinity)
return;
static void set_affinity(void)
{
+#if HAVE_SCHED_SETAFFINITY
cpu_set_t mask;
- int cpu;
- int ret;
+ int cpu, ret;
+#endif /* HAVE_SCHED_SETAFFINITY */
if (!use_affinity)
return;
void set_affinity(void)
{
+#if HAVE_SCHED_SETAFFINITY
cpu_set_t mask;
- int cpu;
- int ret;
+ int cpu, ret;
+#endif /* HAVE_SCHED_SETAFFINITY */
if (!use_affinity)
return;
static void set_affinity(void)
{
+#if HAVE_SCHED_SETAFFINITY
cpu_set_t mask;
- int cpu;
- int ret;
+ int cpu, ret;
+#endif /* HAVE_SCHED_SETAFFINITY */
if (!use_affinity)
return;
static void set_affinity(void)
{
+#if HAVE_SCHED_SETAFFINITY
cpu_set_t mask;
- int cpu;
- int ret;
+ int cpu, ret;
+#endif /* HAVE_SCHED_SETAFFINITY */
if (!use_affinity)
return;
static void set_affinity(void)
{
+#if HAVE_SCHED_SETAFFINITY
cpu_set_t mask;
- int cpu;
- int ret;
+ int cpu, ret;
+#endif /* HAVE_SCHED_SETAFFINITY */
if (!use_affinity)
return;
static void set_affinity(void)
{
+#if HAVE_SCHED_SETAFFINITY
cpu_set_t mask;
- int cpu;
- int ret;
+ int cpu, ret;
+#endif /* HAVE_SCHED_SETAFFINITY */
if (!use_affinity)
return;
static void set_affinity(void)
{
+#if HAVE_SCHED_SETAFFINITY
cpu_set_t mask;
- int cpu;
- int ret;
+ int cpu, ret;
+#endif /* HAVE_SCHED_SETAFFINITY */
if (!use_affinity)
return;
static void set_affinity(void)
{
+#if HAVE_SCHED_SETAFFINITY
cpu_set_t mask;
- int cpu;
- int ret;
+ int cpu, ret;
+#endif /* HAVE_SCHED_SETAFFINITY */
if (!use_affinity)
return;
static void set_affinity(void)
{
+#if HAVE_SCHED_SETAFFINITY
cpu_set_t mask;
- int cpu;
- int ret;
+ int cpu, ret;
+#endif /* HAVE_SCHED_SETAFFINITY */
if (!use_affinity)
return;