]> git.sur5r.net Git - openldap/blobdiff - libraries/libmdb/mdb.c
Add another FIXME comment
[openldap] / libraries / libmdb / mdb.c
index ec30e8040d75d2ef5d1af5f86834316614a37229..489bbde65618e372a2e9df5b28051fa3f4ef6531 100644 (file)
@@ -48,7 +48,6 @@
 #include <time.h>
 #include <unistd.h>
 #include <pthread.h>
-#include <endian.h>
 
 #include "mdb.h"
 
@@ -93,7 +92,11 @@ typedef struct MDB_rxbody {
 } 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 {
@@ -223,6 +226,9 @@ typedef struct MDB_ppage {                                  /* ordered list of pages */
 } 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)