Index: kernel/generic/src/adt/cht.c
===================================================================
--- kernel/generic/src/adt/cht.c	(revision 63e27efdf2fe6d3fa02bbb5ee1da00df5cc07e9d)
+++ kernel/generic/src/adt/cht.c	(revision 3061bc129a855122d429fbba1e623a521aaa164c)
@@ -35,5 +35,5 @@
  * @file
  * @brief Scalable resizable concurrent lock-free hash table.
- * 
+ *
  * CHT is a concurrent hash table that is scalable resizable and lock-free.
  * resizable = the number of buckets of the table increases or decreases
@@ -48,10 +48,10 @@
  * fraction of updates (insert/remove) increases. Other data structures
  * significantly outperform CHT if the fraction of updates exceeds ~40%.
- * 
+ *
  * CHT tolerates hardware exceptions and may be accessed from exception
  * handlers as long as the underlying RCU implementation is exception safe.
- * 
+ *
  * @par Caveats
- * 
+ *
  * 0) Never assume an item is still in the table.
  * The table may be accessed concurrently; therefore, other threads may
@@ -59,20 +59,20 @@
  * in the table if cht_find() just returned it to you. Similarly, an
  * item may have already been inserted by the time cht_find() returns NULL.
- * 
+ *
  * 1) Always use RCU read locks when searching the table.
  * Holding an RCU lock guarantees that an item found in the table remains
  * valid (eg is not freed) even if the item was removed from the table
  * in the meantime by another thread.
- * 
+ *
  * 2) Never update values in place.
  * Do not update items in the table in place, ie directly. The changes
  * will not propagate to other readers (on other cpus) immediately or even
  * correctly. Some readers may then encounter items that have only some
- * of their fields changed or are completely inconsistent. 
- * 
- * Instead consider inserting an updated/changed copy of the item and 
+ * of their fields changed or are completely inconsistent.
+ *
+ * Instead consider inserting an updated/changed copy of the item and
  * removing the original item. Or contact the maintainer to provide
  * you with a function that atomically replaces an item with a copy.
- * 
+ *
  * 3) Use cht_insert_unique() instead of checking for duplicates with cht_find()
  * The following code is prone to race conditions:
@@ -84,41 +84,41 @@
  * @endcode
  * See cht_insert_unique() on how to correctly fix this.
- * 
+ *
  *
  * @par Semantics
- * 
+ *
  * Lazy readers = cht_find_lazy(), cht_find_next_lazy()
  * Readers = lazy readers, cht_find(), cht_find_next()
- * Updates = cht_insert(), cht_insert_unique(), cht_remove_key(), 
+ * Updates = cht_insert(), cht_insert_unique(), cht_remove_key(),
  *     cht_remove_item()
- * 
- * Readers (but not lazy readers) are guaranteed to see the effects 
- * of @e completed updates. In other words, if cht_find() is invoked 
- * after a cht_insert() @e returned eg on another cpu, cht_find() is 
- * guaranteed to see the inserted item. 
- * 
+ *
+ * Readers (but not lazy readers) are guaranteed to see the effects
+ * of @e completed updates. In other words, if cht_find() is invoked
+ * after a cht_insert() @e returned eg on another cpu, cht_find() is
+ * guaranteed to see the inserted item.
+ *
  * Similarly, updates see the effects of @e completed updates. For example,
- * issuing cht_remove() after a cht_insert() for that key returned (even 
+ * issuing cht_remove() after a cht_insert() for that key returned (even
  * on another cpu) is guaranteed to remove the inserted item.
- * 
+ *
  * Reading or updating the table concurrently with other updates
  * always returns consistent data and never corrupts the table.
  * However the effects of concurrent updates may or may not be
  * visible to all other concurrent readers or updaters. Eg, not
- * all readers may see that an item has already been inserted 
- * if cht_insert() has not yet returned. 
- * 
+ * all readers may see that an item has already been inserted
+ * if cht_insert() has not yet returned.
+ *
  * Lazy readers are guaranteed to eventually see updates but it
  * may take some time (possibly milliseconds) after the update
  * completes for the change to propagate to lazy readers on all
  * cpus.
- * 
+ *
  * @par Implementation
- * 
+ *
  * Collisions in CHT are resolved with chaining. The number of buckets
- * is always a power of 2. Each bucket is represented with a single linked 
- * lock-free list [1]. Items in buckets are sorted by their mixed hashes 
- * in ascending order. All buckets are terminated with a single global 
- * sentinel node whose mixed hash value is the greatest possible. 
+ * is always a power of 2. Each bucket is represented with a single linked
+ * lock-free list [1]. Items in buckets are sorted by their mixed hashes
+ * in ascending order. All buckets are terminated with a single global
+ * sentinel node whose mixed hash value is the greatest possible.
  *
  * CHT with 2^k buckets uses the k most significant bits of a hash value
@@ -127,32 +127,32 @@
  * hash function does not produce uniform hashes, hash values are
  * mixed first so that the top bits of a mixed hash change even if hash
- * values differ only in the least significant bits. The mixed hash 
- * values are cached in cht_link.hash (which is overwritten once the 
+ * values differ only in the least significant bits. The mixed hash
+ * values are cached in cht_link.hash (which is overwritten once the
  * item is scheduled for removal via rcu_call).
- * 
+ *
  * A new item is inserted before all other existing items in the bucket
  * with the same hash value as the newly inserted item (a la the original
- * lock-free list [2]). Placing new items at the start of a same-hash 
- * sequence of items (eg duplicates) allows us to easily check for duplicates 
- * in cht_insert_unique(). The function can first check that there are 
- * no duplicates of the newly inserted item amongst the items with the 
- * same hash as the new item. If there were no duplicates the new item 
- * is linked before the same-hash items. Inserting a duplicate while 
- * the function is checking for duplicates is detected as a change of 
- * the link to the first checked same-hash item (and the search for 
+ * lock-free list [2]). Placing new items at the start of a same-hash
+ * sequence of items (eg duplicates) allows us to easily check for duplicates
+ * in cht_insert_unique(). The function can first check that there are
+ * no duplicates of the newly inserted item amongst the items with the
+ * same hash as the new item. If there were no duplicates the new item
+ * is linked before the same-hash items. Inserting a duplicate while
+ * the function is checking for duplicates is detected as a change of
+ * the link to the first checked same-hash item (and the search for
  * duplicates can be restarted).
- * 
+ *
  * @par Table resize algorithm
- * 
+ *
  * Table resize is based on [3] and [5]. First, a new bucket head array
  * is allocated and initialized. Second, old bucket heads are moved
- * to the new bucket head array with the protocol mentioned in [5]. 
+ * to the new bucket head array with the protocol mentioned in [5].
  * At this point updaters start using the new bucket heads. Third,
  * buckets are split (or joined) so that the table can make use of
  * the extra bucket head slots in the new array (or stop wasting space
  * with the unnecessary extra slots in the old array). Splitting
- * or joining buckets employs a custom protocol. Last, the new array 
+ * or joining buckets employs a custom protocol. Last, the new array
  * replaces the original bucket array.
- * 
+ *
  * A single background work item (of the system work queue) guides
  * resizing of the table. If an updater detects that the bucket it
@@ -160,51 +160,51 @@
  * or it needs to be split/joined), it helps out and completes the
  * head move or the bucket split/join.
- * 
- * The table always grows or shrinks by a factor of 2. Because items 
- * are assigned a bucket based on the top k bits of their mixed hash 
- * values, when growing the table each bucket is split into two buckets 
- * and all items of the two new buckets come from the single bucket in the 
+ *
+ * The table always grows or shrinks by a factor of 2. Because items
+ * are assigned a bucket based on the top k bits of their mixed hash
+ * values, when growing the table each bucket is split into two buckets
+ * and all items of the two new buckets come from the single bucket in the
  * original table. Ie items from separate buckets in the original table
- * never intermix in the new buckets. Moreover 
- * since the buckets are sorted by their mixed hash values the items 
- * at the beginning of the old bucket will end up in the first new 
+ * never intermix in the new buckets. Moreover
+ * since the buckets are sorted by their mixed hash values the items
+ * at the beginning of the old bucket will end up in the first new
  * bucket while all the remaining items of the old bucket will end up
- * in the second new bucket. Therefore, there is a single point where 
- * to split the linked list of the old bucket into two correctly sorted 
+ * in the second new bucket. Therefore, there is a single point where
+ * to split the linked list of the old bucket into two correctly sorted
  * linked lists of the new buckets:
  *                            .- bucket split
- *                            | 
- *             <-- first -->  v  <-- second --> 
+ *                            |
+ *             <-- first -->  v  <-- second -->
  *   [old] --> [00b] -> [01b] -> [10b] -> [11b] -> sentinel
- *              ^                 ^    
- *   [new0] -- -+                 |  
+ *              ^                 ^
+ *   [new0] -- -+                 |
  *   [new1] -- -- -- -- -- -- -- -+
- * 
+ *
  * Resize in greater detail:
- * 
- * a) First, a resizer (a single background system work queue item 
- * in charge of resizing the table) allocates and initializes a new 
- * bucket head array. New bucket heads are pointed to the sentinel 
- * and marked Invalid (in the lower order bits of the pointer to the 
+ *
+ * a) First, a resizer (a single background system work queue item
+ * in charge of resizing the table) allocates and initializes a new
+ * bucket head array. New bucket heads are pointed to the sentinel
+ * and marked Invalid (in the lower order bits of the pointer to the
  * next item, ie the sentinel in this case):
- * 
+ *
  *   [old, N] --> [00b] -> [01b] -> [10b] -> [11b] -> sentinel
  *                                                    ^ ^
  *   [new0, Inv] -------------------------------------+ |
  *   [new1, Inv] ---------------------------------------+
- * 
- * 
- * b) Second, the resizer starts moving old bucket heads with the following 
- * lock-free protocol (from [5]) where cas(variable, expected_val, new_val) 
+ *
+ *
+ * b) Second, the resizer starts moving old bucket heads with the following
+ * lock-free protocol (from [5]) where cas(variable, expected_val, new_val)
  * is short for compare-and-swap:
- * 
+ *
  *   old head     new0 head      transition to next state
  *   --------     ---------      ------------------------
  *   addr, N      sentinel, Inv  cas(old, (addr, N), (addr, Const))
- *                               .. mark the old head as immutable, so that 
- *                                  updaters do not relink it to other nodes 
+ *                               .. mark the old head as immutable, so that
+ *                                  updaters do not relink it to other nodes
  *                                  until the head move is done.
  *   addr, Const  sentinel, Inv  cas(new0, (sentinel, Inv), (addr, N))
- *                               .. move the address to the new head and mark 
+ *                               .. move the address to the new head and mark
  *                                  the new head normal so updaters can start
  *                                  using it.
@@ -213,20 +213,20 @@
  *                                  the head move is done.
  *   addr, Inv    addr, N
- * 
+ *
  * Notice that concurrent updaters may step in at any point and correctly
  * complete the head move without disrupting the resizer. At worst, the
- * resizer or other concurrent updaters will attempt a number of CAS() that 
+ * resizer or other concurrent updaters will attempt a number of CAS() that
  * will correctly fail.
- * 
+ *
  *   [old, Inv] -> [00b] -> [01b] -> [10b] -> [11b] -> sentinel
  *                 ^                                   ^
  *   [new0, N] ----+                                   |
  *   [new1, Inv] --------------------------------------+
- * 
- *  
- * c) Third, buckets are split if the table is growing; or joined if 
- * shrinking (by the resizer or updaters depending on whoever accesses 
+ *
+ *
+ * c) Third, buckets are split if the table is growing; or joined if
+ * shrinking (by the resizer or updaters depending on whoever accesses
  * the bucket first). See split_bucket() and join_buckets() for details.
- * 
+ *
  *  1) Mark the last item of new0 with JOIN_FOLLOWS:
  *   [old, Inv] -> [00b] -> [01b, JF] -> [10b] -> [11b] -> sentinel
@@ -234,5 +234,5 @@
  *   [new0, N] ----+                                       |
  *   [new1, Inv] ------------------------------------------+
- * 
+ *
  *  2) Mark the first item of new1 with JOIN_NODE:
  *   [old, Inv] -> [00b] -> [01b, JF] -> [10b, JN] -> [11b] -> sentinel
@@ -240,5 +240,5 @@
  *   [new0, N] ----+                                           |
  *   [new1, Inv] ----------------------------------------------+
- * 
+ *
  *  3) Point new1 to the join-node and mark new1 NORMAL.
  *   [old, Inv] -> [00b] -> [01b, JF] -> [10b, JN] -> [11b] -> sentinel
@@ -246,12 +246,12 @@
  *   [new0, N] ----+                     |
  *   [new1, N] --------------------------+
- * 
- * 
- * d) Fourth, the resizer cleans up extra marks added during bucket 
+ *
+ *
+ * d) Fourth, the resizer cleans up extra marks added during bucket
  * splits/joins but only when it is sure all updaters are accessing
  * the table via the new bucket heads only (ie it is certain there
- * are no delayed updaters unaware of the resize and accessing the 
+ * are no delayed updaters unaware of the resize and accessing the
  * table via the old bucket head).
- * 
+ *
  *   [old, Inv] ---+
  *                 v
@@ -259,16 +259,16 @@
  *                                      v
  *   [new1, N] --> [10b, N] -> [11b] -> sentinel
- * 
- * 
+ *
+ *
  * e) Last, the resizer publishes the new bucket head array for everyone
  * to see and use. This signals the end of the resize and the old bucket
- * array is freed. 
- * 
- * 
+ * array is freed.
+ *
+ *
  * To understand details of how the table is resized, read [1, 3, 5]
  * and comments in join_buckets(), split_bucket().
- *  
- * 
- * [1] High performance dynamic lock-free hash tables and list-based sets, 
+ *
+ *
+ * [1] High performance dynamic lock-free hash tables and list-based sets,
  *     Michael, 2002
  *     http://www.research.ibm.com/people/m/michael/spaa-2002.pdf
@@ -311,11 +311,11 @@
 #define CHT_MIN_BUCKET_CNT (1 << CHT_MIN_ORDER)
 /* Does not have to be a power of 2. */
-#define CHT_MAX_LOAD 2 
+#define CHT_MAX_LOAD 2
 
 typedef cht_ptr_t marked_ptr_t;
 typedef bool (*equal_pred_t)(void *arg, const cht_link_t *item);
 
-/** The following mark items and bucket heads. 
- * 
+/** The following mark items and bucket heads.
+ *
  * They are stored in the two low order bits of the next item pointers.
  * Some marks may be combined. Some marks share the same binary value and
@@ -327,22 +327,22 @@
 	N_NORMAL = 0,
 	/** Logically deleted item that might have already been unlinked.
-	 * 
-	 * May be combined with N_JOIN and N_JOIN_FOLLOWS. Applicable only 
-	 * to items; never to bucket heads. 
-	 * 
-	 * Once marked deleted an item remains marked deleted.	 
+	 *
+	 * May be combined with N_JOIN and N_JOIN_FOLLOWS. Applicable only
+	 * to items; never to bucket heads.
+	 *
+	 * Once marked deleted an item remains marked deleted.
 	 */
 	N_DELETED = 1,
-	/** Immutable bucket head. 
-	 * 
-	 * The bucket is being moved or joined with another and its (old) head 
+	/** Immutable bucket head.
+	 *
+	 * The bucket is being moved or joined with another and its (old) head
 	 * must not be modified.
-	 * 
+	 *
 	 * May be combined with N_INVALID. Applicable only to old bucket heads,
 	 * ie cht_t.b and not cht_t.new_b.
 	 */
 	N_CONST = 1,
-	/** Invalid bucket head. The bucket head must not be modified. 
-	 * 
+	/** Invalid bucket head. The bucket head must not be modified.
+	 *
 	 * Old bucket heads (ie cht_t.b) are marked invalid if they have
 	 * already been moved to cht_t.new_b or if the bucket had already
@@ -354,12 +354,12 @@
 	N_INVALID = 3,
 	/** The item is a join node, ie joining two buckets
-	 * 
+	 *
 	 * A join node is either the first node of the second part of
 	 * a bucket to be split; or it is the first node of the bucket
 	 * to be merged into/appended to/joined with another bucket.
-	 * 
-	 * May be combined with N_DELETED. Applicable only to items, never 
+	 *
+	 * May be combined with N_DELETED. Applicable only to items, never
 	 * to bucket heads.
-	 * 
+	 *
 	 * Join nodes are referred to from two different buckets and may,
 	 * therefore, not be safely/atomically unlinked from both buckets.
@@ -369,12 +369,12 @@
 	 */
 	N_JOIN = 2,
-	/** The next node is a join node and will soon be marked so. 
-	 * 
+	/** The next node is a join node and will soon be marked so.
+	 *
 	 * A join-follows node is the last node of the first part of bucket
 	 * that is to be split, ie it is the last node that will remain
 	 * in the same bucket after splitting it.
-	 * 
+	 *
 	 * May be combined with N_DELETED. Applicable to items as well
-	 * as to bucket heads of the bucket to be split (but only in cht_t.new_b). 
+	 * as to bucket heads of the bucket to be split (but only in cht_t.new_b).
 	 */
 	N_JOIN_FOLLOWS = 2,
@@ -413,31 +413,31 @@
 
 static size_t size_to_order(size_t bucket_cnt, size_t min_order);
-static cht_buckets_t *alloc_buckets(size_t order, bool set_invalid, 
+static cht_buckets_t *alloc_buckets(size_t order, bool set_invalid,
 	bool can_block);
 static inline cht_link_t *find_lazy(cht_t *h, void *key);
-static cht_link_t *search_bucket(cht_t *h, marked_ptr_t head, void *key, 
+static cht_link_t *search_bucket(cht_t *h, marked_ptr_t head, void *key,
 	size_t search_hash);
-static cht_link_t *find_resizing(cht_t *h, void *key, size_t hash, 
+static cht_link_t *find_resizing(cht_t *h, void *key, size_t hash,
 	marked_ptr_t old_head, size_t old_idx);
 static bool insert_impl(cht_t *h, cht_link_t *item, cht_link_t **dup_item);
 static bool insert_at(cht_link_t *item, const wnd_t *wnd, walk_mode_t walk_mode,
 	bool *resizing);
-static bool has_duplicate(cht_t *h, const cht_link_t *item, size_t hash, 
+static bool has_duplicate(cht_t *h, const cht_link_t *item, size_t hash,
 	cht_link_t *cur, cht_link_t **dup_item);
-static cht_link_t *find_duplicate(cht_t *h, const cht_link_t *item, size_t hash, 
+static cht_link_t *find_duplicate(cht_t *h, const cht_link_t *item, size_t hash,
 	cht_link_t *start);
 static bool remove_pred(cht_t *h, size_t hash, equal_pred_t pred, void *pred_arg);
-static bool delete_at(cht_t *h, wnd_t *wnd, walk_mode_t walk_mode, 
+static bool delete_at(cht_t *h, wnd_t *wnd, walk_mode_t walk_mode,
 	bool *deleted_but_gc, bool *resizing);
 static bool mark_deleted(cht_link_t *cur, walk_mode_t walk_mode, bool *resizing);
 static bool unlink_from_pred(wnd_t *wnd, walk_mode_t walk_mode, bool *resizing);
-static bool find_wnd_and_gc_pred(cht_t *h, size_t hash, walk_mode_t walk_mode, 
+static bool find_wnd_and_gc_pred(cht_t *h, size_t hash, walk_mode_t walk_mode,
 	equal_pred_t pred, void *pred_arg, wnd_t *wnd, bool *resizing);
-static bool find_wnd_and_gc(cht_t *h, size_t hash, walk_mode_t walk_mode, 
+static bool find_wnd_and_gc(cht_t *h, size_t hash, walk_mode_t walk_mode,
 	wnd_t *wnd, bool *resizing);
 static bool gc_deleted_node(cht_t *h, walk_mode_t walk_mode, wnd_t *wnd,
 	bool *resizing);
 static bool join_completed(cht_t *h, const wnd_t *wnd);
-static void upd_resizing_head(cht_t *h, size_t hash, marked_ptr_t **phead, 
+static void upd_resizing_head(cht_t *h, size_t hash, marked_ptr_t **phead,
 	bool *join_finishing,  walk_mode_t *walk_mode);
 static void item_removed(cht_t *h);
@@ -448,12 +448,12 @@
 static void mark_const(marked_ptr_t *psrc_head);
 static void complete_head_move(marked_ptr_t *psrc_head, marked_ptr_t *pdest_head);
-static void split_bucket(cht_t *h, marked_ptr_t *psrc_head, 
+static void split_bucket(cht_t *h, marked_ptr_t *psrc_head,
 	marked_ptr_t *pdest_head, size_t split_hash);
-static void mark_join_follows(cht_t *h, marked_ptr_t *psrc_head, 
+static void mark_join_follows(cht_t *h, marked_ptr_t *psrc_head,
 	size_t split_hash, wnd_t *wnd);
 static void mark_join_node(cht_link_t *join_node);
-static void join_buckets(cht_t *h, marked_ptr_t *psrc_head, 
+static void join_buckets(cht_t *h, marked_ptr_t *psrc_head,
 	marked_ptr_t *pdest_head, size_t split_hash);
-static void link_to_join_node(cht_t *h, marked_ptr_t *pdest_head, 
+static void link_to_join_node(cht_t *h, marked_ptr_t *pdest_head,
 	cht_link_t *join_node, size_t split_hash);
 static void resize_table(work_t *arg);
@@ -461,5 +461,5 @@
 static void shrink_table(cht_t *h);
 static void cleanup_join_node(cht_t *h, marked_ptr_t *new_head);
-static void clear_join_and_gc(cht_t *h, cht_link_t *join_node, 
+static void clear_join_and_gc(cht_t *h, cht_link_t *join_node,
 	marked_ptr_t *new_head);
 static void cleanup_join_follows(cht_t *h, marked_ptr_t *new_head);
@@ -478,7 +478,7 @@
 static size_t grow_idx(size_t idx);
 static size_t shrink_idx(size_t idx);
-static marked_ptr_t cas_link(marked_ptr_t *link, const cht_link_t *cur_next, 
+static marked_ptr_t cas_link(marked_ptr_t *link, const cht_link_t *cur_next,
 	mark_t cur_mark, const cht_link_t *new_next, mark_t new_mark);
-static marked_ptr_t _cas_link(marked_ptr_t *link, marked_ptr_t cur, 
+static marked_ptr_t _cas_link(marked_ptr_t *link, marked_ptr_t cur,
 	marked_ptr_t new);
 static void cas_order_barrier(void);
@@ -490,5 +490,5 @@
 
 /** Creates a concurrent hash table.
- * 
+ *
  * @param h         Valid pointer to a cht_t instance.
  * @param op        Item specific operations. All operations are compulsory.
@@ -497,9 +497,9 @@
 bool cht_create_simple(cht_t *h, cht_ops_t *op)
 {
-	return cht_create(h, 0, 0, 0, false, op); 
+	return cht_create(h, 0, 0, 0, false, op);
 }
 
 /** Creates a concurrent hash table.
- * 
+ *
  * @param h         Valid pointer to a cht_t instance.
  * @param init_size The initial number of buckets the table should contain.
@@ -513,11 +513,11 @@
  *                  before the table grows.
  * @param can_block If true creating the table blocks until enough memory
- *                  is available (possibly indefinitely). Otherwise, 
+ *                  is available (possibly indefinitely). Otherwise,
  *                  table creation does not block and returns immediately
- *                  even if not enough memory is available. 
+ *                  even if not enough memory is available.
  * @param op        Item specific operations. All operations are compulsory.
  * @return True if successfully created the table. False otherwise.
  */
-bool cht_create(cht_t *h, size_t init_size, size_t min_size, size_t max_load, 
+bool cht_create(cht_t *h, size_t init_size, size_t min_size, size_t max_load,
 	bool can_block, cht_ops_t *op)
 {
@@ -551,5 +551,5 @@
 	}
 	
-	/* 
+	/*
 	 * Cached item hashes are stored in item->rcu_link.func. Once the item
 	 * is deleted rcu_link.func will contain the value of invalid_hash.
@@ -564,13 +564,13 @@
 
 /** Allocates and initializes 2^order buckets.
- * 
+ *
  * All bucket heads are initialized to point to the sentinel node.
- * 
+ *
  * @param order       The number of buckets to allocate is 2^order.
  * @param set_invalid Bucket heads are marked invalid if true; otherwise
  *                    they are marked N_NORMAL.
  * @param can_block   If true memory allocation blocks until enough memory
- *                    is available (possibly indefinitely). Otherwise, 
- *                    memory allocation does not block. 
+ *                    is available (possibly indefinitely). Otherwise,
+ *                    memory allocation does not block.
  * @return Newly allocated and initialized buckets or NULL if not enough memory.
  */
@@ -578,5 +578,5 @@
 {
 	size_t bucket_cnt = (1 << order);
-	size_t bytes = 
+	size_t bytes =
 		sizeof(cht_buckets_t) + (bucket_cnt - 1) * sizeof(marked_ptr_t);
 	cht_buckets_t *b = malloc(bytes, can_block ? 0 : FRAME_ATOMIC);
@@ -587,6 +587,6 @@
 	b->order = order;
 	
-	marked_ptr_t head_link = set_invalid 
-		? make_link(&sentinel, N_INVALID) 
+	marked_ptr_t head_link = set_invalid
+		? make_link(&sentinel, N_INVALID)
 		: make_link(&sentinel, N_NORMAL);
 	
@@ -615,5 +615,5 @@
 
 /** Destroys a CHT successfully created via cht_create().
- * 
+ *
  * Waits for all outstanding concurrent operations to complete and
  * frees internal allocated resources. The table is however not cleared
@@ -644,16 +644,16 @@
 
 /** Returns the first item equal to the search key or NULL if not found.
- * 
- * The call must be enclosed in a rcu_read_lock() unlock() pair. The 
+ *
+ * The call must be enclosed in a rcu_read_lock() unlock() pair. The
  * returned item is guaranteed to be allocated until rcu_read_unlock()
  * although the item may be concurrently removed from the table by another
  * cpu.
- * 
+ *
  * Further items matching the key may be retrieved via cht_find_next().
- * 
+ *
  * cht_find() sees the effects of any completed cht_remove(), cht_insert().
  * If a concurrent remove or insert had not yet completed cht_find() may
  * or may not see the effects of it (eg it may find an item being removed).
- * 
+ *
  * @param h   CHT to operate on.
  * @param key Search key as defined by cht_ops_t.key_equal() and .key_hash().
@@ -668,11 +668,11 @@
 
 /** Returns the first item equal to the search key or NULL if not found.
- * 
- * Unlike cht_find(), cht_find_lazy() may not see the effects of 
+ *
+ * Unlike cht_find(), cht_find_lazy() may not see the effects of
  * cht_remove() or cht_insert() even though they have already completed.
  * It may take a couple of milliseconds for those changes to propagate
- * and become visible to cht_find_lazy(). On the other hand, cht_find_lazy() 
+ * and become visible to cht_find_lazy(). On the other hand, cht_find_lazy()
  * operates a bit faster than cht_find().
- * 
+ *
  * See cht_find() for more details.
  */
@@ -693,6 +693,6 @@
 	cht_buckets_t *b = rcu_access(h->b);
 	size_t idx = calc_bucket_idx(hash, b->order);
-	/* 
-	 * No need for access_once. b->head[idx] will point to an allocated node 
+	/*
+	 * No need for access_once. b->head[idx] will point to an allocated node
 	 * even if marked invalid until we exit rcu read section.
 	 */
@@ -706,11 +706,11 @@
 }
 
-/** Returns the next item matching \a item. 
- * 
- * Must be enclosed in a rcu_read_lock()/unlock() pair. Effects of 
+/** Returns the next item matching \a item.
+ *
+ * Must be enclosed in a rcu_read_lock()/unlock() pair. Effects of
  * completed cht_remove(), cht_insert() are guaranteed to be visible
  * to cht_find_next().
- * 
- * See cht_find() for more details.  
+ *
+ * See cht_find() for more details.
  */
 cht_link_t *cht_find_next(cht_t *h, const cht_link_t *item)
@@ -721,11 +721,11 @@
 }
 
-/** Returns the next item matching \a item. 
- * 
- * Must be enclosed in a rcu_read_lock()/unlock() pair. Effects of 
+/** Returns the next item matching \a item.
+ *
+ * Must be enclosed in a rcu_read_lock()/unlock() pair. Effects of
  * completed cht_remove(), cht_insert() may or may not be visible
  * to cht_find_next_lazy().
- * 
- * See cht_find_lazy() for more details.  
+ *
+ * See cht_find_lazy() for more details.
  */
 cht_link_t *cht_find_next_lazy(cht_t *h, const cht_link_t *item)
@@ -739,10 +739,10 @@
 
 /** Searches the bucket at head for key using search_hash. */
-static inline cht_link_t *search_bucket(cht_t *h, marked_ptr_t head, void *key, 
+static inline cht_link_t *search_bucket(cht_t *h, marked_ptr_t head, void *key,
 	size_t search_hash)
 {
-	/* 
+	/*
 	 * It is safe to access nodes even outside of this bucket (eg when
-	 * splitting the bucket). The resizer makes sure that any node we 
+	 * splitting the bucket). The resizer makes sure that any node we
 	 * may find by following the next pointers is allocated.
 	 */
@@ -759,7 +759,7 @@
 	} while (node_hash(h, cur) < search_hash);
 	
-	/* 
+	/*
 	 * Only search for an item with an equal key if cur is not the sentinel
-	 * node or a node with a different hash. 
+	 * node or a node with a different hash.
 	 */
 	while (node_hash(h, cur) == search_hash) {
@@ -771,7 +771,7 @@
 		cur = get_next(cur->link);
 		assert(cur);
-	} 
-	
-	/* 
+	}
+	
+	/*
 	 * In the unlikely case that we have encountered a node whose cached
 	 * hash has been overwritten due to a pending rcu_call for it, skip
@@ -787,8 +787,8 @@
 
 /** Searches for the key while the table is undergoing a resize. */
-static cht_link_t *find_resizing(cht_t *h, void *key, size_t hash, 
+static cht_link_t *find_resizing(cht_t *h, void *key, size_t hash,
 	marked_ptr_t old_head, size_t old_idx)
 {
-	assert(N_INVALID == get_mark(old_head)); 
+	assert(N_INVALID == get_mark(old_head));
 	assert(h->new_b);
 	
@@ -799,5 +799,5 @@
 	/* Growing. */
 	if (h->b->order < h->new_b->order) {
-		/* 
+		/*
 		 * Old bucket head is invalid, so it must have been already
 		 * moved. Make the new head visible if still not visible, ie
@@ -805,11 +805,11 @@
 		 */
 		if (N_INVALID == get_mark(new_head)) {
-			/* 
+			/*
 			 * We should be searching a newly added bucket but the old
-			 * moved bucket has not yet been split (its marked invalid) 
-			 * or we have not yet seen the split. 
+			 * moved bucket has not yet been split (its marked invalid)
+			 * or we have not yet seen the split.
 			 */
 			if (grow_idx(old_idx) != new_idx) {
-				/* 
+				/*
 				 * Search the moved bucket. It is guaranteed to contain
 				 * items of the newly added bucket that were present
@@ -821,5 +821,5 @@
 			/* new_head is now the moved bucket, either valid or invalid. */
 			
-			/* 
+			/*
 			 * The old bucket was definitely moved to new_head but the
 			 * change of new_head had not yet propagated to this cpu.
@@ -829,9 +829,9 @@
 				 * We could issue a read_barrier() and make the now valid
 				 * moved bucket head new_head visible, but instead fall back
-				 * on using the old bucket. Although the old bucket head is 
-				 * invalid, it points to a node that is allocated and in the 
+				 * on using the old bucket. Although the old bucket head is
+				 * invalid, it points to a node that is allocated and in the
 				 * right bucket. Before the node can be freed, it must be
 				 * unlinked from the head (or another item after that item
-				 * modified the new_head) and a grace period must elapse. 
+				 * modified the new_head) and a grace period must elapse.
 				 * As a result had the node been already freed the grace
 				 * period preceeding the free() would make the unlink and
@@ -855,17 +855,17 @@
 		
 		/*
-		 * h->b->head[move_src_idx] had already been moved to new_head 
+		 * h->b->head[move_src_idx] had already been moved to new_head
 		 * but the change to new_head had not yet propagated to us.
 		 */
 		if (N_INVALID == get_mark(new_head)) {
 			/*
-			 * new_head is definitely valid and we could make it visible 
-			 * to this cpu with a read_barrier(). Instead, use the bucket 
-			 * in the old table that was moved even though it is now marked 
+			 * new_head is definitely valid and we could make it visible
+			 * to this cpu with a read_barrier(). Instead, use the bucket
+			 * in the old table that was moved even though it is now marked
 			 * as invalid. The node it points to must be allocated because
 			 * a grace period would have to elapse before it could be freed;
-			 * and the grace period would make the now valid new_head 
-			 * visible to all cpus. 
-			 * 
+			 * and the grace period would make the now valid new_head
+			 * visible to all cpus.
+			 *
 			 * Note that move_src_idx may not be the same as old_idx.
 			 * If move_src_idx != old_idx then old_idx is the bucket
@@ -873,8 +873,8 @@
 			 * appended to the moved bucket, ie it is added at the tail
 			 * of new_head. In that case an invalid old_head notes that
-			 * it had already been merged into (the moved) new_head. 
+			 * it had already been merged into (the moved) new_head.
 			 * We will try to search that bucket first because it
-			 * may contain some newly added nodes after the bucket 
-			 * join. Moreover, the bucket joining link may already be 
+			 * may contain some newly added nodes after the bucket
+			 * join. Moreover, the bucket joining link may already be
 			 * visible even if new_head is not. Therefore, if we're
 			 * lucky we'll find the item via moved_old_head. In any
@@ -895,6 +895,6 @@
 		if (move_src_idx != old_idx && get_next(old_head) != &sentinel) {
 			/*
-			 * Note that old_head (the bucket to be merged into new_head) 
-			 * points to an allocated join node (if non-null) even if marked 
+			 * Note that old_head (the bucket to be merged into new_head)
+			 * points to an allocated join node (if non-null) even if marked
 			 * invalid. Before the resizer lets join nodes to be unlinked
 			 * (and freed) it sets old_head to NULL and waits for a grace period.
@@ -909,10 +909,10 @@
 		return NULL;
 	} else {
-		/* 
+		/*
 		 * Resize is almost done. The resizer is waiting to make
 		 * sure all cpus see that the new table replaced the old one.
 		 */
 		assert(h->b->order == h->new_b->order);
-		/* 
+		/*
 		 * The resizer must ensure all new bucket heads are visible before
 		 * replacing the old table.
@@ -929,10 +929,10 @@
 }
 
-/** Inserts a unique item. Returns false if an equal item was already present. 
- * 
+/** Inserts a unique item. Returns false if an equal item was already present.
+ *
  * Use this function to atomically check if an equal/duplicate item had
- * not yet been inserted into the table and to insert this item into the 
+ * not yet been inserted into the table and to insert this item into the
  * table.
- * 
+ *
  * The following is @e NOT thread-safe, so do not use:
  * @code
@@ -944,5 +944,5 @@
  * }
  * @endcode
- * 
+ *
  * Replace such code with:
  * @code
@@ -951,5 +951,5 @@
  *     // Whoops, someone beat us to it - an equal item 'dup_item'
  *     // had already been inserted.
- *     free(item); 
+ *     free(item);
  * } else {
  *     // Successfully inserted the item and we are guaranteed that
@@ -957,5 +957,5 @@
  * }
  * @endcode
- * 
+ *
  */
 bool cht_insert_unique(cht_t *h, cht_link_t *item, cht_link_t **dup_item)
@@ -1007,5 +1007,5 @@
 		}
 		
-		inserted = insert_at(item, &wnd, walk_mode, &resizing);		
+		inserted = insert_at(item, &wnd, walk_mode, &resizing);
 	} while (!inserted);
 	
@@ -1016,11 +1016,11 @@
 }
 
-/** Inserts item between wnd.ppred and wnd.cur. 
- * 
+/** Inserts item between wnd.ppred and wnd.cur.
+ *
  * @param item      Item to link to wnd.ppred and wnd.cur.
  * @param wnd       The item will be inserted before wnd.cur. Wnd.ppred
  *                  must be N_NORMAL.
- * @param walk_mode 
- * @param resizing  Set to true only if the table is undergoing resize 
+ * @param walk_mode
+ * @param resizing  Set to true only if the table is undergoing resize
  *         and it was not expected (ie walk_mode == WM_NORMAL).
  * @return True if the item was successfully linked to wnd.ppred. False
@@ -1028,5 +1028,5 @@
  *         of wnd.cur has changed.
  */
-inline static bool insert_at(cht_link_t *item, const wnd_t *wnd, 
+inline static bool insert_at(cht_link_t *item, const wnd_t *wnd,
 	walk_mode_t walk_mode, bool *resizing)
 {
@@ -1076,5 +1076,5 @@
 
 /** Returns true if the chain starting at cur has an item equal to \a item.
- * 
+ *
  * @param h    CHT to operate on.
  * @param item Item whose duplicates the function looks for.
@@ -1084,5 +1084,5 @@
  * @return True if a non-deleted item equal to \a item exists in the table.
  */
-static inline bool has_duplicate(cht_t *h, const cht_link_t *item, size_t hash, 
+static inline bool has_duplicate(cht_t *h, const cht_link_t *item, size_t hash,
 	cht_link_t *cur, cht_link_t **dup_item)
 {
@@ -1095,7 +1095,7 @@
 		return false;
 
-	/* 
-	 * Load the most recent node marks. Otherwise we might pronounce a 
-	 * logically deleted node for a duplicate of the item just because 
+	/*
+	 * Load the most recent node marks. Otherwise we might pronounce a
+	 * logically deleted node for a duplicate of the item just because
 	 * the deleted node's DEL mark had not yet propagated to this cpu.
 	 */
@@ -1107,5 +1107,5 @@
 
 /** Returns an item that is equal to \a item starting in a chain at \a start. */
-static cht_link_t *find_duplicate(cht_t *h, const cht_link_t *item, size_t hash, 
+static cht_link_t *find_duplicate(cht_t *h, const cht_link_t *item, size_t hash,
 	cht_link_t *start)
 {
@@ -1114,5 +1114,5 @@
 	cht_link_t *cur = start;
 	
-try_again:	
+try_again:
 	assert(cur);
 
@@ -1128,5 +1128,5 @@
 		cur = get_next(cur->link);
 		assert(cur);
-	} 
+	}
 
 	/* Skip logically deleted nodes with rcu_call() in progress. */
@@ -1147,5 +1147,5 @@
 	size_t removed = 0;
 	
-	while (remove_pred(h, hash, h->op->key_equal, key)) 
+	while (remove_pred(h, hash, h->op->key_equal, key))
 		++removed;
 	
@@ -1153,11 +1153,11 @@
 }
 
-/** Removes a specific item from the table. 
- * 
- * The called must hold rcu read lock. 
- * 
+/** Removes a specific item from the table.
+ *
+ * The called must hold rcu read lock.
+ *
  * @param item Item presumably present in the table and to be removed.
  * @return True if the item was removed successfully; or false if it had
- *     already been deleted. 
+ *     already been deleted.
  */
 bool cht_remove_item(cht_t *h, cht_link_t *item)
@@ -1168,7 +1168,7 @@
 	assert(rcu_read_locked());
 
-	/* 
+	/*
 	 * Even though we know the node we want to delete we must unlink it
-	 * from the correct bucket and from a clean/normal predecessor. Therefore, 
+	 * from the correct bucket and from a clean/normal predecessor. Therefore,
 	 * we search for it again from the beginning of the correct bucket.
 	 */
@@ -1213,12 +1213,12 @@
 		}
 		
-		/* 
+		/*
 		 * The item lookup is affected by a bucket join but effects of
 		 * the bucket join have not been seen while searching for the item.
 		 */
 		if (join_finishing && !join_completed(h, &wnd)) {
-			/* 
-			 * Bucket was appended at the end of another but the next 
-			 * ptr linking them together was not visible on this cpu. 
+			/*
+			 * Bucket was appended at the end of another but the next
+			 * ptr linking them together was not visible on this cpu.
 			 * join_completed() makes this appended bucket visible.
 			 */
@@ -1237,5 +1237,5 @@
 		}
 		
-		deleted = delete_at(h, &wnd, walk_mode, &deleted_but_gc, &resizing);		
+		deleted = delete_at(h, &wnd, walk_mode, &deleted_but_gc, &resizing);
 	} while (!deleted || deleted_but_gc);
 	
@@ -1245,13 +1245,13 @@
 
 /** Unlinks wnd.cur from wnd.ppred and schedules a deferred free for the item.
- * 
+ *
  * Ignores nodes marked N_JOIN if walk mode is WM_LEAVE_JOIN.
- * 
+ *
  * @param h   CHT to operate on.
  * @param wnd Points to the item to delete and its N_NORMAL predecessor.
  * @param walk_mode Bucket chaing walk mode.
- * @param deleted_but_gc Set to true if the item had been logically deleted, 
+ * @param deleted_but_gc Set to true if the item had been logically deleted,
  *         but a garbage collecting walk of the bucket is in order for
- *         it to be fully unlinked.         
+ *         it to be fully unlinked.
  * @param resizing Set to true if the table is undergoing an unexpected
  *         resize (ie walk_mode == WM_NORMAL).
@@ -1259,5 +1259,5 @@
  *         delete operation must be retried.
  */
-static inline bool delete_at(cht_t *h, wnd_t *wnd, walk_mode_t walk_mode, 
+static inline bool delete_at(cht_t *h, wnd_t *wnd, walk_mode_t walk_mode,
 	bool *deleted_but_gc, bool *resizing)
 {
@@ -1289,12 +1289,12 @@
 
 /** Marks cur logically deleted. Returns false to request a retry. */
-static inline bool mark_deleted(cht_link_t *cur, walk_mode_t walk_mode, 
+static inline bool mark_deleted(cht_link_t *cur, walk_mode_t walk_mode,
 	bool *resizing)
 {
 	assert(cur && cur != &sentinel);
 	
-	/* 
+	/*
 	 * Btw, we could loop here if the cas fails but let's not complicate
-	 * things and let's retry from the head of the bucket. 
+	 * things and let's retry from the head of the bucket.
 	 */
 	
@@ -1315,10 +1315,10 @@
 		mark_t cur_mark = get_mark(cur->link) & N_JOIN_FOLLOWS;
 		
-		marked_ptr_t ret = 
+		marked_ptr_t ret =
 			cas_link(&cur->link, next, cur_mark, next, cur_mark | N_DELETED);
 		
 		if (ret != make_link(next, cur_mark))
 			return false;
-	} 
+	}
 	
 	return true;
@@ -1326,5 +1326,5 @@
 
 /** Unlinks wnd.cur from wnd.ppred. Returns false if it should be retried. */
-static inline bool unlink_from_pred(wnd_t *wnd, walk_mode_t walk_mode, 
+static inline bool unlink_from_pred(wnd_t *wnd, walk_mode_t walk_mode,
 	bool *resizing)
 {
@@ -1355,5 +1355,5 @@
 		marked_ptr_t pred_link = make_link(wnd->cur, N_NORMAL);
 		/* Link to cur's successor keeping/copying cur's JF mark. */
-		marked_ptr_t next_link = make_link(next, cur_mark);		
+		marked_ptr_t next_link = make_link(next, cur_mark);
 		
 		marked_ptr_t ret = _cas_link(wnd->ppred, pred_link, next_link);
@@ -1361,5 +1361,5 @@
 		if (pred_link != ret) {
 			/* If we're not resizing the table there are no JF/JN nodes. */
-			*resizing = (walk_mode == WM_NORMAL) 
+			*resizing = (walk_mode == WM_NORMAL)
 				&& (N_JOIN_FOLLOWS & get_mark(ret));
 			return false;
@@ -1371,9 +1371,9 @@
 
 /** Finds the first non-deleted item equal to \a pred_arg according to \a pred.
- * 
+ *
  * The function returns the candidate item in \a wnd. Logically deleted
  * nodes are garbage collected so the predecessor will most likely not
- * be marked as deleted. 
- * 
+ * be marked as deleted.
+ *
  * Unlike find_wnd_and_gc(), this function never returns a node that
  * is known to have already been marked N_DELETED.
@@ -1382,5 +1382,5 @@
  * collected, ie free in the background via rcu_call (except for join-nodes
  * if walk_mode == WM_LEAVE_JOIN).
- * 
+ *
  * @param h         CHT to operate on.
  * @param hash      Hash the search for.
@@ -1392,8 +1392,8 @@
  * @param resizing  Set to true if the table is resizing but it was not
  *                  expected (ie walk_mode == WM_NORMAL).
- * @return False if the operation has to be retried. True otherwise 
+ * @return False if the operation has to be retried. True otherwise
  *        (even if an equal item had not been found).
  */
-static bool find_wnd_and_gc_pred(cht_t *h, size_t hash, walk_mode_t walk_mode, 
+static bool find_wnd_and_gc_pred(cht_t *h, size_t hash, walk_mode_t walk_mode,
 	equal_pred_t pred, void *pred_arg, wnd_t *wnd, bool *resizing)
 {
@@ -1403,6 +1403,6 @@
 		return true;
 	
-	/* 
-	 * A read barrier is not needed here to bring up the most recent 
+	/*
+	 * A read barrier is not needed here to bring up the most recent
 	 * node marks (esp the N_DELETED). At worst we'll try to delete
 	 * an already deleted node; fail in delete_at(); and retry.
@@ -1411,5 +1411,5 @@
 	size_t cur_hash;
 
-try_again:	
+try_again:
 	cur_hash = node_hash(h, wnd->cur);
 		
@@ -1445,25 +1445,25 @@
 
 /** Find the first item (deleted or not) with a hash greater or equal to \a hash.
- * 
- * The function returns the first item with a hash that is greater or 
+ *
+ * The function returns the first item with a hash that is greater or
  * equal to \a hash in \a wnd. Moreover it garbage collects logically
  * deleted node that have not yet been unlinked and freed. Therefore,
  * the returned node's predecessor will most likely be N_NORMAL.
- * 
+ *
  * Unlike find_wnd_and_gc_pred(), this function may return a node
  * that is known to had been marked N_DELETED.
- *  
+ *
  * @param h         CHT to operate on.
  * @param hash      Hash of the item to find.
  * @param walk_mode Bucket chain walk mode.
- * @param[in,out] wnd wnd.cur denotes the first node of the chain. If the 
- *                  the operation is successful, \a wnd points to the desired 
+ * @param[in,out] wnd wnd.cur denotes the first node of the chain. If the
+ *                  the operation is successful, \a wnd points to the desired
  *                  item.
  * @param resizing  Set to true if a table resize was detected but walk_mode
  *                  suggested the table was not undergoing a resize.
- * @return False indicates the operation must be retried. True otherwise 
+ * @return False indicates the operation must be retried. True otherwise
  *       (even if an item with exactly the same has was not found).
  */
-static bool find_wnd_and_gc(cht_t *h, size_t hash, walk_mode_t walk_mode, 
+static bool find_wnd_and_gc(cht_t *h, size_t hash, walk_mode_t walk_mode,
 	wnd_t *wnd, bool *resizing)
 {
@@ -1505,5 +1505,5 @@
 	} else {
 		/* Ordinary deleted node or a deleted JOIN_FOLLOWS. */
-		assert(walk_mode != WM_LEAVE_JOIN 
+		assert(walk_mode != WM_LEAVE_JOIN
 			|| !((N_JOIN | N_JOIN_FOLLOWS) & get_mark(wnd->cur->link)));
 
@@ -1525,8 +1525,8 @@
 
 /** Returns true if a bucket join had already completed.
- * 
- * May only be called if upd_resizing_head() indicates a bucket join 
+ *
+ * May only be called if upd_resizing_head() indicates a bucket join
  * may be in progress.
- * 
+ *
  * If it returns false, the search must be retried in order to guarantee
  * all item that should have been encountered have been seen.
@@ -1534,15 +1534,15 @@
 static bool join_completed(cht_t *h, const wnd_t *wnd)
 {
-	/* 
-	 * The table is shrinking and the searched for item is in a bucket 
-	 * appended to another. Check that the link joining these two buckets 
+	/*
+	 * The table is shrinking and the searched for item is in a bucket
+	 * appended to another. Check that the link joining these two buckets
 	 * is visible and if not, make it visible to this cpu.
 	 */
 	
-	/* 
-	 * Resizer ensures h->b->order stays the same for the duration of this 
+	/*
+	 * Resizer ensures h->b->order stays the same for the duration of this
 	 * func. We got here because there was an alternative head to search.
 	 * The resizer waits for all preexisting readers to finish after
-	 * it 
+	 * it
 	 */
 	assert(h->b->order > h->new_b->order);
@@ -1565,13 +1565,13 @@
 		size_t move_src_idx = grow_idx(shrink_idx(last_old_idx));
 		
-		/* 
-		 * Last node seen was in the joining bucket - if the searched 
-		 * for node is there we will find it. 
+		/*
+		 * Last node seen was in the joining bucket - if the searched
+		 * for node is there we will find it.
 		 */
-		if (move_src_idx != last_old_idx) 
+		if (move_src_idx != last_old_idx)
 			return true;
 	}
 	
-	/* 
+	/*
 	 * Reached the end of the bucket but no nodes from the joining bucket
 	 * were seen. There should have at least been a JOIN node so we have
@@ -1584,9 +1584,9 @@
 
 /** When resizing returns the bucket head to start the search with in \a phead.
- * 
+ *
  * If a resize had been detected (eg cht_t.b.head[idx] is marked immutable).
  * upd_resizing_head() moves the bucket for \a hash from the old head
  * to the new head. Moreover, it splits or joins buckets as necessary.
- * 
+ *
  * @param h     CHT to operate on.
  * @param hash  Hash of an item whose chain we would like to traverse.
@@ -1595,7 +1595,7 @@
  *              in progress and the bucket may have to traversed again
  *              as indicated by join_completed().
- * @param[out] walk_mode Specifies how to interpret node marks.  
- */
-static void upd_resizing_head(cht_t *h, size_t hash, marked_ptr_t **phead, 
+ * @param[out] walk_mode Specifies how to interpret node marks.
+ */
+static void upd_resizing_head(cht_t *h, size_t hash, marked_ptr_t **phead,
 	bool *join_finishing,  walk_mode_t *walk_mode)
 {
@@ -1621,6 +1621,6 @@
 		if (move_dest_idx == new_idx) {
 			assert(pmoved_head == pnew_head);
-			/* 
-			 * move_head() makes the new head of the moved bucket visible. 
+			/*
+			 * move_head() makes the new head of the moved bucket visible.
 			 * The new head may be marked with a JOIN_FOLLOWS
 			 */
@@ -1629,6 +1629,6 @@
 		} else {
 			assert(pmoved_head != pnew_head);
-			/* 
-			 * The hash belongs to the bucket that is the result of splitting 
+			/*
+			 * The hash belongs to the bucket that is the result of splitting
 			 * the old/moved bucket, ie the bucket that contains the second
 			 * half of the split/old/moved bucket.
@@ -1639,6 +1639,6 @@
 				size_t split_hash = calc_split_hash(new_idx, h->new_b->order);
 				split_bucket(h, pmoved_head, pnew_head, split_hash);
-				/* 
-				 * split_bucket() makes the new head visible. No 
+				/*
+				 * split_bucket() makes the new head visible. No
 				 * JOIN_FOLLOWS in this part of split bucket.
 				 */
@@ -1653,6 +1653,6 @@
 		size_t move_src_idx = grow_idx(new_idx);
 		
-		/* 
-		 * Complete moving the bucket from the old to the new table. 
+		/*
+		 * Complete moving the bucket from the old to the new table.
 		 * Makes a valid pnew_head visible if already moved.
 		 */
@@ -1667,5 +1667,5 @@
 			}
 			
-			/* 
+			/*
 			 * The resizer sets pold_head to &sentinel when all cpus are
 			 * guaranteed to see the bucket join.
@@ -1681,6 +1681,6 @@
 		*walk_mode = WM_LEAVE_JOIN;
 	} else {
-		/* 
-		 * Final stage of resize. The resizer is waiting for all 
+		/*
+		 * Final stage of resize. The resizer is waiting for all
 		 * readers to notice that the old table had been replaced.
 		 */
@@ -1700,13 +1700,13 @@
 #endif
 
-/** Moves an immutable head \a psrc_head of cht_t.b to \a pdest_head of cht_t.new_b. 
- * 
+/** Moves an immutable head \a psrc_head of cht_t.b to \a pdest_head of cht_t.new_b.
+ *
  * The function guarantees the move will be visible on this cpu once
  * it completes. In particular, *pdest_head will not be N_INVALID.
- * 
+ *
  * Unlike complete_head_move(), help_head_move() checks if the head had already
  * been moved and tries to avoid moving the bucket heads if possible.
  */
-static inline void help_head_move(marked_ptr_t *psrc_head, 
+static inline void help_head_move(marked_ptr_t *psrc_head,
 	marked_ptr_t *pdest_head)
 {
@@ -1729,6 +1729,6 @@
 
 /** Initiates the move of the old head \a psrc_head.
- * 
- * The move may be completed with help_head_move(). 
+ *
+ * The move may be completed with help_head_move().
  */
 static void start_head_move(marked_ptr_t *psrc_head)
@@ -1766,6 +1766,6 @@
 	cas_order_barrier();
 	
-	DBG(ret = ) 
-		cas_link(psrc_head, next, N_CONST, next, N_INVALID);	
+	DBG(ret = )
+		cas_link(psrc_head, next, N_CONST, next, N_INVALID);
 	assert(ret == make_link(next, N_CONST) || (N_INVALID == get_mark(ret)));
 	cas_order_barrier();
@@ -1773,17 +1773,17 @@
 
 /** Splits the bucket at psrc_head and links to the remainder from pdest_head.
- * 
+ *
  * Items with hashes greater or equal to \a split_hash are moved to bucket
- * with head at \a pdest_head. 
- * 
+ * with head at \a pdest_head.
+ *
  * @param h           CHT to operate on.
  * @param psrc_head   Head of the bucket to split (in cht_t.new_b).
  * @param pdest_head  Head of the bucket that points to the second part
  *                    of the split bucket in psrc_head. (in cht_t.new_b)
- * @param split_hash  Hash of the first possible item in the remainder of 
+ * @param split_hash  Hash of the first possible item in the remainder of
  *                    psrc_head, ie the smallest hash pdest_head is allowed
  *                    to point to..
  */
-static void split_bucket(cht_t *h, marked_ptr_t *psrc_head, 
+static void split_bucket(cht_t *h, marked_ptr_t *psrc_head,
 	marked_ptr_t *pdest_head, size_t split_hash)
 {
@@ -1794,9 +1794,9 @@
 	/*
 	 * L == Last node of the first part of the split bucket. That part
-	 *      remains in the original/src bucket. 
+	 *      remains in the original/src bucket.
 	 * F == First node of the second part of the split bucket. That part
 	 *      will be referenced from the dest bucket head.
 	 *
-	 * We want to first mark a clean L as JF so that updaters unaware of 
+	 * We want to first mark a clean L as JF so that updaters unaware of
 	 * the split (or table resize):
 	 * - do not insert a new node between L and F
@@ -1804,31 +1804,31 @@
 	 * - do not unlink F
 	 *
-	 * Then we can safely mark F as JN even if it has been marked deleted. 
-	 * Once F is marked as JN updaters aware of table resize will not 
+	 * Then we can safely mark F as JN even if it has been marked deleted.
+	 * Once F is marked as JN updaters aware of table resize will not
 	 * attempt to unlink it (JN will have two predecessors - we cannot
-	 * safely unlink from both at the same time). Updaters unaware of 
-	 * ongoing resize can reach F only via L and that node is already 
+	 * safely unlink from both at the same time). Updaters unaware of
+	 * ongoing resize can reach F only via L and that node is already
 	 * marked JF, so they won't unlink F.
-	 * 
+	 *
 	 * Last, link the new/dest head to F.
-	 * 
-	 * 
-	 * 0)                           ,-- split_hash, first hash of the dest bucket 
-	 *                              v  
+	 *
+	 *
+	 * 0)                           ,-- split_hash, first hash of the dest bucket
+	 *                              v
 	 *  [src_head | N] -> .. -> [L] -> [F]
 	 *  [dest_head | Inv]
-	 * 
+	 *
 	 * 1)                             ,-- split_hash
-	 *                                v  
+	 *                                v
 	 *  [src_head | N] -> .. -> [JF] -> [F]
 	 *  [dest_head | Inv]
-	 * 
+	 *
 	 * 2)                             ,-- split_hash
-	 *                                v  
+	 *                                v
 	 *  [src_head | N] -> .. -> [JF] -> [JN]
 	 *  [dest_head | Inv]
-	 * 
+	 *
 	 * 3)                             ,-- split_hash
-	 *                                v  
+	 *                                v
 	 *  [src_head | N] -> .. -> [JF] -> [JN]
 	 *                                   ^
@@ -1845,12 +1845,12 @@
 	/* There are nodes in the dest bucket, ie the second part of the split. */
 	if (wnd.cur != &sentinel) {
-		/* 
-		 * Mark the first node of the dest bucket as a join node so 
-		 * updaters do not attempt to unlink it if it is deleted. 
+		/*
+		 * Mark the first node of the dest bucket as a join node so
+		 * updaters do not attempt to unlink it if it is deleted.
 		 */
 		mark_join_node(wnd.cur);
 		cas_order_barrier();
 	} else {
-		/* 
+		/*
 		 * Second part of the split bucket is empty. There are no nodes
 		 * to mark as JOIN nodes and there never will be.
@@ -1868,14 +1868,14 @@
 
 /** Finds and marks the last node of psrc_head w/ hash less than split_hash.
- * 
- * Finds a node in psrc_head with the greatest hash that is strictly less 
- * than split_hash and marks it with N_JOIN_FOLLOWS. 
- * 
- * Returns a window pointing to that node. 
- * 
- * Any logically deleted nodes along the way are 
- * garbage collected; therefore, the predecessor node (if any) will most 
+ *
+ * Finds a node in psrc_head with the greatest hash that is strictly less
+ * than split_hash and marks it with N_JOIN_FOLLOWS.
+ *
+ * Returns a window pointing to that node.
+ *
+ * Any logically deleted nodes along the way are
+ * garbage collected; therefore, the predecessor node (if any) will most
  * likely not be marked N_DELETED.
- * 
+ *
  * @param h          CHT to operate on.
  * @param psrc_head  Bucket head.
@@ -1884,5 +1884,5 @@
  * @param[out] wnd   Points to the node marked with N_JOIN_FOLLOWS.
  */
-static void mark_join_follows(cht_t *h, marked_ptr_t *psrc_head, 
+static void mark_join_follows(cht_t *h, marked_ptr_t *psrc_head,
 	size_t split_hash, wnd_t *wnd)
 {
@@ -1896,8 +1896,8 @@
 		wnd->cur = get_next(*psrc_head);
 		
-		/* 
+		/*
 		 * Find the split window, ie the last node of the first part of
 		 * the split bucket and the its successor - the first node of
-		 * the second part of the split bucket. Retry if GC failed. 
+		 * the second part of the split bucket. Retry if GC failed.
 		 */
 		if (!find_wnd_and_gc(h, split_hash, WM_MOVE_JOIN_FOLLOWS, wnd, &resizing))
@@ -1906,6 +1906,6 @@
 		/* Must not report that the table is resizing if WM_MOVE_JOIN_FOLLOWS.*/
 		assert(!resizing);
-		/* 
-		 * Mark the last node of the first half of the split bucket 
+		/*
+		 * Mark the last node of the first half of the split bucket
 		 * that a join node follows. It must be clean/normal.
 		 */
@@ -1913,7 +1913,7 @@
 			= cas_link(wnd->ppred, wnd->cur, N_NORMAL, wnd->cur, N_JOIN_FOLLOWS);
 
-		/* 
-		 * Successfully marked as a JF node or already marked that way (even 
-		 * if also marked deleted - unlinking the node will move the JF mark). 
+		/*
+		 * Successfully marked as a JF node or already marked that way (even
+		 * if also marked deleted - unlinking the node will move the JF mark).
 		 */
 		done = (ret == make_link(wnd->cur, N_NORMAL))
@@ -1932,9 +1932,9 @@
 		mark_t mark = get_mark(join_node->link);
 		
-		/* 
-		 * May already be marked as deleted, but it won't be unlinked 
+		/*
+		 * May already be marked as deleted, but it won't be unlinked
 		 * because its predecessor is marked with JOIN_FOLLOWS or CONST.
 		 */
-		marked_ptr_t ret 
+		marked_ptr_t ret
 			= cas_link(&join_node->link, next, mark, next, mark | N_JOIN);
 		
@@ -1946,5 +1946,5 @@
 
 /** Appends the bucket at psrc_head to the bucket at pdest_head.
- * 
+ *
  * @param h          CHT to operate on.
  * @param psrc_head  Bucket to merge with pdest_head.
@@ -1952,5 +1952,5 @@
  * @param split_hash The smallest hash psrc_head may contain.
  */
-static void join_buckets(cht_t *h, marked_ptr_t *psrc_head, 
+static void join_buckets(cht_t *h, marked_ptr_t *psrc_head,
 	marked_ptr_t *pdest_head, size_t split_hash)
 {
@@ -1959,18 +1959,18 @@
 		return;
 	/*
-	 * F == First node of psrc_head, ie the bucket we want to append 
+	 * F == First node of psrc_head, ie the bucket we want to append
 	 *      to (ie join with) the bucket starting at pdest_head.
 	 * L == Last node of pdest_head, ie the bucket that psrc_head will
-	 *      be appended to. 
-	 *
-	 * (1) We first mark psrc_head immutable to signal that a join is 
-	 * in progress and so that updaters unaware of the join (or table 
+	 *      be appended to.
+	 *
+	 * (1) We first mark psrc_head immutable to signal that a join is
+	 * in progress and so that updaters unaware of the join (or table
 	 * resize):
 	 * - do not insert new nodes between the head psrc_head and F
 	 * - do not unlink F (it may already be marked deleted)
-	 * 
+	 *
 	 * (2) Next, F is marked as a join node. Updaters aware of table resize
-	 * will not attempt to unlink it. We cannot safely/atomically unlink 
-	 * the join node because it will be pointed to from two different 
+	 * will not attempt to unlink it. We cannot safely/atomically unlink
+	 * the join node because it will be pointed to from two different
 	 * buckets. Updaters unaware of resize will fail to unlink the join
 	 * node due to the head being marked immutable.
@@ -1978,48 +1978,48 @@
 	 * (3) Then the tail of the bucket at pdest_head is linked to the join
 	 * node. From now on, nodes in both buckets can be found via pdest_head.
-	 * 
+	 *
 	 * (4) Last, mark immutable psrc_head as invalid. It signals updaters
 	 * that the join is complete and they can insert new nodes (originally
-	 * destined for psrc_head) into pdest_head. 
-	 * 
+	 * destined for psrc_head) into pdest_head.
+	 *
 	 * Note that pdest_head keeps pointing at the join node. This allows
 	 * lookups and updaters to determine if they should see a link between
 	 * the tail L and F when searching for nodes originally in psrc_head
-	 * via pdest_head. If they reach the tail of pdest_head without 
+	 * via pdest_head. If they reach the tail of pdest_head without
 	 * encountering any nodes of psrc_head, either there were no nodes
 	 * in psrc_head to begin with or the link between L and F did not
 	 * yet propagate to their cpus. If psrc_head was empty, it remains
-	 * NULL. Otherwise psrc_head points to a join node (it will not be 
+	 * NULL. Otherwise psrc_head points to a join node (it will not be
 	 * unlinked until table resize completes) and updaters/lookups
 	 * should issue a read_barrier() to make the link [L]->[JN] visible.
-	 * 
-	 * 0)                           ,-- split_hash, first hash of the src bucket 
-	 *                              v  
+	 *
+	 * 0)                           ,-- split_hash, first hash of the src bucket
+	 *                              v
 	 *  [dest_head | N]-> .. -> [L]
-	 *  [src_head | N]--> [F] -> .. 
+	 *  [src_head | N]--> [F] -> ..
 	 *  ^
 	 *  ` split_hash, first hash of the src bucket
-	 * 
+	 *
 	 * 1)                            ,-- split_hash
-	 *                               v  
+	 *                               v
 	 *  [dest_head | N]-> .. -> [L]
-	 *  [src_head | C]--> [F] -> .. 
-	 * 
+	 *  [src_head | C]--> [F] -> ..
+	 *
 	 * 2)                            ,-- split_hash
-	 *                               v  
+	 *                               v
 	 *  [dest_head | N]-> .. -> [L]
-	 *  [src_head | C]--> [JN] -> .. 
-	 * 
+	 *  [src_head | C]--> [JN] -> ..
+	 *
 	 * 3)                            ,-- split_hash
-	 *                               v  
+	 *                               v
 	 *  [dest_head | N]-> .. -> [L] --+
 	 *                                v
-	 *  [src_head | C]-------------> [JN] -> .. 
-	 * 
+	 *  [src_head | C]-------------> [JN] -> ..
+	 *
 	 * 4)                            ,-- split_hash
-	 *                               v  
+	 *                               v
 	 *  [dest_head | N]-> .. -> [L] --+
 	 *                                v
-	 *  [src_head | Inv]-----------> [JN] -> .. 
+	 *  [src_head | Inv]-----------> [JN] -> ..
 	 */
 	
@@ -2038,5 +2038,5 @@
 		link_to_join_node(h, pdest_head, join_node, split_hash);
 		cas_order_barrier();
-	} 
+	}
 	
 	DBG(marked_ptr_t ret = )
@@ -2049,5 +2049,5 @@
 
 /** Links the tail of pdest_head to join_node.
- * 
+ *
  * @param h          CHT to operate on.
  * @param pdest_head Head of the bucket whose tail is to be linked to join_node.
@@ -2057,5 +2057,5 @@
  *                   (originally) in pdest_head.
  */
-static void link_to_join_node(cht_t *h, marked_ptr_t *pdest_head, 
+static void link_to_join_node(cht_t *h, marked_ptr_t *pdest_head,
 	cht_link_t *join_node, size_t split_hash)
 {
@@ -2077,5 +2077,5 @@
 		if (wnd.cur != &sentinel) {
 			/* Must be from the new appended bucket. */
-			assert(split_hash <= node_hash(h, wnd.cur) 
+			assert(split_hash <= node_hash(h, wnd.cur)
 				|| h->invalid_hash == node_hash(h, wnd.cur));
 			return;
@@ -2083,5 +2083,5 @@
 		
 		/* Reached the tail of pdest_head - link it to the join node. */
-		marked_ptr_t ret = 
+		marked_ptr_t ret =
 			cas_link(wnd.ppred, &sentinel, N_NORMAL, join_node, N_NORMAL);
 		
@@ -2090,6 +2090,6 @@
 }
 
-/** Instructs RCU to free the item once all preexisting references are dropped. 
- * 
+/** Instructs RCU to free the item once all preexisting references are dropped.
+ *
  * The item is freed via op->remove_callback().
  */
@@ -2098,5 +2098,5 @@
 	assert(item != &sentinel);
 	
-	/* 
+	/*
 	 * remove_callback only works as rcu_func_t because rcu_link is the first
 	 * field in cht_link_t.
@@ -2108,6 +2108,6 @@
 
 /** Notes that an item had been unlinked from the table and shrinks it if needed.
- * 
- * If the number of items in the table drops below 1/4 of the maximum 
+ *
+ * If the number of items in the table drops below 1/4 of the maximum
  * allowed load the table is shrunk in the background.
  */
@@ -2129,6 +2129,6 @@
 }
 
-/** Notes an item had been inserted and grows the table if needed. 
- * 
+/** Notes an item had been inserted and grows the table if needed.
+ *
  * The table is resized in the background.
  */
@@ -2192,5 +2192,5 @@
 
 	/* Failed to alloc a new table - try next time the resizer is run. */
-	if (!h->new_b) 
+	if (!h->new_b)
 		return;
 
@@ -2199,6 +2199,6 @@
 	size_t old_bucket_cnt = (1 << h->b->order);
 	
-	/* 
-	 * Give updaters a chance to help out with the resize. Do the minimum 
+	/*
+	 * Give updaters a chance to help out with the resize. Do the minimum
 	 * work needed to announce a resize is in progress, ie start moving heads.
 	 */
@@ -2227,8 +2227,8 @@
 	}
 	
-	/* 
+	/*
 	 * Wait for all updaters to notice the new heads. Once everyone sees
 	 * the invalid old bucket heads they will know a resize is in progress
-	 * and updaters will modify the correct new buckets. 
+	 * and updaters will modify the correct new buckets.
 	 */
 	rcu_synchronize();
@@ -2241,7 +2241,7 @@
 	}
 
-	/* 
+	/*
 	 * Wait for everyone to notice that buckets were split, ie link connecting
-	 * the join follows and join node has been cut. 
+	 * the join follows and join node has been cut.
 	 */
 	rcu_synchronize();
@@ -2278,5 +2278,5 @@
 
 	/* Failed to alloc a new table - try next time the resizer is run. */
-	if (!h->new_b) 
+	if (!h->new_b)
 		return;
 
@@ -2286,6 +2286,6 @@
 	size_t old_bucket_cnt = (1 << h->b->order);
 	
-	/* 
-	 * Give updaters a chance to help out with the resize. Do the minimum 
+	/*
+	 * Give updaters a chance to help out with the resize. Do the minimum
 	 * work needed to announce a resize is in progress, ie start moving heads.
 	 */
@@ -2318,13 +2318,13 @@
 			/* This bucket should join the moved bucket. */
 			size_t split_hash = calc_split_hash(old_idx, h->b->order);
-			join_buckets(h, &h->b->head[old_idx], &h->new_b->head[new_idx], 
+			join_buckets(h, &h->b->head[old_idx], &h->new_b->head[new_idx],
 				split_hash);
 		}
 	}
 	
-	/* 
+	/*
 	 * Wait for all updaters to notice the new heads. Once everyone sees
 	 * the invalid old bucket heads they will know a resize is in progress
-	 * and updaters will modify the correct new buckets. 
+	 * and updaters will modify the correct new buckets.
 	 */
 	rcu_synchronize();
@@ -2389,5 +2389,5 @@
 
 /** Clears the join_node's N_JOIN mark frees it if marked N_DELETED as well. */
-static void clear_join_and_gc(cht_t *h, cht_link_t *join_node, 
+static void clear_join_and_gc(cht_t *h, cht_link_t *join_node,
 	marked_ptr_t *new_head)
 {
@@ -2404,5 +2404,5 @@
 		mark_t cleared_mark = get_mark(jn_link) & N_DELETED;
 
-		marked_ptr_t ret = 
+		marked_ptr_t ret =
 			_cas_link(&join_node->link, jn_link, make_link(next, cleared_mark));
 
@@ -2429,5 +2429,5 @@
 		};
 		
-		done = find_wnd_and_gc_pred(h, jn_hash, WM_NORMAL, same_node_pred, 
+		done = find_wnd_and_gc_pred(h, jn_hash, WM_NORMAL, same_node_pred,
 			join_node, &wnd, &resizing);
 		
@@ -2452,9 +2452,9 @@
 	 * Find the non-deleted node with a JF mark and clear the JF mark.
 	 * The JF node may be deleted and/or the mark moved to its neighbors
-	 * at any time. Therefore, we GC deleted nodes until we find the JF 
-	 * node in order to remove stale/deleted JF nodes left behind eg by 
-	 * delayed threads that did not yet get a chance to unlink the deleted 
-	 * JF node and move its mark. 
-	 * 
+	 * at any time. Therefore, we GC deleted nodes until we find the JF
+	 * node in order to remove stale/deleted JF nodes left behind eg by
+	 * delayed threads that did not yet get a chance to unlink the deleted
+	 * JF node and move its mark.
+	 *
 	 * Note that the head may be marked JF (but never DELETED).
 	 */
@@ -2481,8 +2481,8 @@
 			if (is_jf_node) {
 				cht_link_t *next = get_next(*cur_link);
-				marked_ptr_t ret = 
+				marked_ptr_t ret =
 					cas_link(cur_link, next, N_JOIN_FOLLOWS, &sentinel, N_NORMAL);
 				
-				assert(next == &sentinel 
+				assert(next == &sentinel
 					|| ((N_JOIN | N_JOIN_FOLLOWS) & get_mark(ret)));
 
@@ -2491,6 +2491,6 @@
 					break;
 				} else {
-					/* 
-					 * The JF node had been deleted or a new node inserted 
+					/*
+					 * The JF node had been deleted or a new node inserted
 					 * right after it. Retry from the head.
 					 */
@@ -2500,5 +2500,5 @@
 			} else {
 				wnd.ppred = cur_link;
-				wnd.cur = get_next(*cur_link);				
+				wnd.cur = get_next(*cur_link);
 			}
 		}
@@ -2512,6 +2512,6 @@
 }
 
-/** Returns the first possible hash following a bucket split point. 
- * 
+/** Returns the first possible hash following a bucket split point.
+ *
  * In other words the returned hash is the smallest possible hash
  * the remainder of the split bucket may contain.
@@ -2558,5 +2558,5 @@
 static inline size_t node_hash(cht_t *h, const cht_link_t *item)
 {
-	assert(item->hash == h->invalid_hash 
+	assert(item->hash == h->invalid_hash
 		|| item->hash == sentinel.hash
 		|| item->hash == calc_node_hash(h, item));
@@ -2569,5 +2569,5 @@
 {
 	assert(item != &sentinel);
-	/* 
+	/*
 	 * Clear the lowest order bit in order for sentinel's node hash
 	 * to be the greatest possible.
@@ -2624,13 +2624,13 @@
 
 /** Compare-and-swaps a next item link. */
-static inline marked_ptr_t cas_link(marked_ptr_t *link, const cht_link_t *cur_next, 
+static inline marked_ptr_t cas_link(marked_ptr_t *link, const cht_link_t *cur_next,
 	mark_t cur_mark, const cht_link_t *new_next, mark_t new_mark)
 {
-	return _cas_link(link, make_link(cur_next, cur_mark), 
+	return _cas_link(link, make_link(cur_next, cur_mark),
 		make_link(new_next, new_mark));
 }
 
 /** Compare-and-swaps a next item link. */
-static inline marked_ptr_t _cas_link(marked_ptr_t *link, marked_ptr_t cur, 
+static inline marked_ptr_t _cas_link(marked_ptr_t *link, marked_ptr_t cur,
 	marked_ptr_t new)
 {
@@ -2640,11 +2640,11 @@
 	 * have to be ordered wrt to other cas(y) to a different location y
 	 * on the same cpu.
-	 * 
-	 * cas(x) must act as a write barrier on x, ie if cas(x) succeeds 
-	 * and is observed by another cpu, then all cpus must be able to 
+	 *
+	 * cas(x) must act as a write barrier on x, ie if cas(x) succeeds
+	 * and is observed by another cpu, then all cpus must be able to
 	 * make the effects of cas(x) visible just by issuing a load barrier.
 	 * For example:
 	 * cpu1         cpu2            cpu3
-	 *                              cas(x, 0 -> 1), succeeds 
+	 *                              cas(x, 0 -> 1), succeeds
 	 *              cas(x, 0 -> 1), fails
 	 *              MB, to order load of x in cas and store to y
@@ -2652,19 +2652,19 @@
 	 * sees y == 7
 	 * loadMB must be enough to make cas(x) on cpu3 visible to cpu1, ie x == 1.
-	 * 
+	 *
 	 * If cas() did not work this way:
 	 * a) our head move protocol would not be correct.
 	 * b) freeing an item linked to a moved head after another item was
 	 *   inserted in front of it, would require more than one grace period.
-	 * 
+	 *
 	 * Ad (a): In the following example, cpu1 starts moving old_head
 	 * to new_head, cpu2 completes the move and cpu3 notices cpu2
 	 * completed the move before cpu1 gets a chance to notice cpu2
-	 * had already completed the move. Our requirements for cas() 
-	 * assume cpu3 will see a valid and mutable value in new_head 
-	 * after issuing a load memory barrier once it has determined 
-	 * the old_head's value had been successfully moved to new_head 
+	 * had already completed the move. Our requirements for cas()
+	 * assume cpu3 will see a valid and mutable value in new_head
+	 * after issuing a load memory barrier once it has determined
+	 * the old_head's value had been successfully moved to new_head
 	 * (because it sees old_head marked invalid).
-	 * 
+	 *
 	 *  cpu1             cpu2             cpu3
 	 *   cas(old_head, <addr, N>, <addr, Const>), succeeds
@@ -2672,24 +2672,24 @@
 	 *   // Move from old_head to new_head started, now the interesting stuff:
 	 *   cas(new_head, <0, Inv>, <addr, N>), succeeds
-	 * 
+	 *
 	 *                    cas(new_head, <0, Inv>, <addr, N>), but fails
 	 *                    cas-order-barrier
 	 *                    cas(old_head, <addr, Const>, <addr, Inv>), succeeds
-	 *                                     
+	 *
 	 *                                     Sees old_head marked Inv (by cpu2)
 	 *                                     load-MB
 	 *                                     assert(new_head == <addr, N>)
-	 *   
+	 *
 	 *   cas-order-barrier
-	 *  
+	 *
 	 * Even though cpu1 did not yet issue a cas-order-barrier, cpu1's store
 	 * to new_head (successful cas()) must be made visible to cpu3 with
 	 * a load memory barrier if cpu1's store to new_head is visible
 	 * on another cpu (cpu2) and that cpu's (cpu2's) store to old_head
-	 * is already visible to cpu3.	 * 
+	 * is already visible to cpu3.	 *
 	 */
 	void *expected = (void*)cur;
 	
-	/* 
+	/*
 	 * Use the acquire-release model, although we could probably
 	 * get away even with the relaxed memory model due to our use
