0.19
+ * Logic fix in branch prediction (thanks Jay!)
* Read through cached support.
* Fixed for cas by key operation.
* Fix for memcached_server_st list structures to have correct count.
#include <libmemcached_config.h>
#if !defined(__GNUC__) || (__GNUC__ == 2 && __GNUC_MINOR__ < 96)
-#define __builtin_expect(x, expected_value) (x)
-
-#define likely(x) __builtin_expect((x),1)
-#define unlikely(x) __builtin_expect((x),0)
-
-#else
#define likely(x) if((x))
#define unlikely(x) if((x))
+#else
+
+#define likely(x) if(__builtin_expect(!!(x), 1))
+#define unlikely(x) if(__builtin_expect((x), 0))
#endif
+
#ifdef HAVE_DTRACE
#define _DTRACE_VERSION 1
#else
memcached_return server_display_function(memcached_st *ptr, memcached_server_st *server, void *context)
{
/* Do Nothing */
- uint32_t *bigger= (uint32_t *)context;
- assert(*bigger <= server->port);
+ uint32_t bigger= *((uint32_t *)(context));
+ assert(bigger <= server->port);
+ *((uint32_t *)(context))= bigger;
return MEMCACHED_SUCCESS;
}