Added randomized read behavior
[m6w6/libmemcached] / libmemcached / common.h
index 96b834632ccfaefa23d3ce5f1bd97acf1e84703d..99d4ce78f103e875a92c655b34d312730c2eaf5c 100644 (file)
@@ -64,8 +64,8 @@ struct memcached_continuum_item_st {
 
 #else
 
-#define likely(x)       if(__builtin_expect(!!(x), 1))
-#define unlikely(x)     if(__builtin_expect((x), 0))
+#define likely(x)       if(__builtin_expect((x) != 0, 1))
+#define unlikely(x)     if(__builtin_expect((x) != 0, 0))
 #endif
 
 
@@ -93,7 +93,8 @@ typedef enum {
   MEM_HASH_WITH_PREFIX_KEY= (1 << 13),
   MEM_NOREPLY= (1 << 14),
   MEM_USE_UDP= (1 << 15),
-  MEM_AUTO_EJECT_HOSTS= (1 << 16)
+  MEM_AUTO_EJECT_HOSTS= (1 << 16),
+  MEM_RANDOMIZE_REPLICA_READ= (1 << 17)
 } memcached_flags;
 
 /* Hashing algo */
@@ -136,7 +137,8 @@ LIBMEMCACHED_LOCAL
 void server_list_free(memcached_st *ptr, memcached_server_st *servers);
 
 LIBMEMCACHED_LOCAL
-memcached_return memcached_key_test(const char **keys, size_t *key_length,
+memcached_return memcached_key_test(const char * const *keys, 
+                                    const size_t *key_length,
                                     size_t number_of_keys);