Created
November 27, 2013 16:02
-
-
Save 5kg/7678152 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| diff --git a/src/common/hashtable/rculfhash.h b/src/common/hashtable/rculfhash.h | |
| index 17cf6db..601feea 100644 | |
| --- a/src/common/hashtable/rculfhash.h | |
| +++ b/src/common/hashtable/rculfhash.h | |
| @@ -34,6 +34,11 @@ | |
| #include "urcu-flavor.h" | |
| +static int __attribute__((noinline)) __is_null_pointer(unsigned long v) | |
| +{ | |
| + return v == 0; | |
| +} | |
| + | |
| #ifdef __cplusplus | |
| extern "C" { | |
| #endif | |
| @@ -458,7 +463,7 @@ void cds_lfht_resize(struct cds_lfht *ht, unsigned long new_size); | |
| for (cds_lfht_first(ht, iter), \ | |
| pos = caa_container_of(cds_lfht_iter_get_node(iter), \ | |
| __typeof__(*(pos)), member); \ | |
| - &(pos)->member != NULL; \ | |
| + !__is_null_pointer((unsigned long) &(pos)->member); \ | |
| cds_lfht_next(ht, iter), \ | |
| pos = caa_container_of(cds_lfht_iter_get_node(iter), \ | |
| __typeof__(*(pos)), member)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment