#include <time.h>
#include <unistd.h>
#include <pthread.h>
-#include <endian.h>
#include "mdb.h"
} MDB_rxbody;
#ifndef CACHELINE
-#define CACHELINE 64 /* most CPUs. Itanium uses 128 */
+# ifdef __APPLE__
+# define CACHELINE 128 /* 64 is too small to contain a mutex */
+# else
+# define CACHELINE 64 /* most CPUs. Itanium uses 128 */
+# endif
#endif
typedef struct MDB_reader {
} MDB_ppage;
SLIST_HEAD(page_stack, MDB_ppage);
+/* FIXME: tree depth is mostly bounded, we should just
+ * use a fixed array and avoid malloc/pointer chasing
+ */
#define CURSOR_EMPTY(c) SLIST_EMPTY(&(c)->mc_stack)
#define CURSOR_TOP(c) SLIST_FIRST(&(c)->mc_stack)
#define CURSOR_POP(c) SLIST_REMOVE_HEAD(&(c)->mc_stack, mp_entry)