#include "lrecord.h"
#include "lstream.h"
+/* for __ase_ffs() */
+#include "ent/ent.h"
#include "skiplist.h"
#define __SKIPLIST_DEBUG__(args...) fprintf(stderr, "SKIPLIST " args)
skiplist_find_hash_return_level(skiplist_t, hcode_t)
__attribute__((always_inline));
-extern int get_random(void);
-
/* high level bindings */
\f
/* low level bindings */
hcode_t h, Lisp_Object key, Lisp_Object value)
{
/* entirely new data, build a node for it */
- /* determine the number of levels to add */
- size_t nlevels = __ase_ffsl(random()), cnt;
+ /* determine the number of levels to add, this is a log distribution
+ * so we use ffs(3) of a random number */
+ size_t nlevels = __ase_ffsl(random());
+ size_t cnt;
skiplist_level_t levels, last = path[psz--];
skiplist_node_t node;