Commits

Armin Rigo  committed 0b3f783

Support non-aligned keys in g2l_insert(), as needed for
stm_call_on_abort().

  • Participants
  • Parent commits c563688

Comments (0)

Files changed (2)

   int shift = 0;
   char *p = (char *)(g2l->toplevel.items);
   char *entry;
-  assert((key & (sizeof(void*)-1)) == 0);   /* only for aligned keys */
   while (1)
     {
       p += (key >> shift) & TREE_MASK;

File c4/test/test_extra.py

         if retry_counter == 0:
             lib.stm_call_on_abort(p1, clear_me)
             lib.stm_call_on_abort(p2, clear_me)
-            lib.stm_call_on_abort(p3, clear_me)
+            lib.stm_call_on_abort(p3 + 1, clear_me)
             lib.stm_call_on_abort(p2, ffi.NULL)
         #
         assert ffi.string(p0) == "aaa"
             abort_and_retry()
         else:
             assert ffi.string(p1) == "iello"
-            assert ffi.string(p3) == "xorld"
+            assert ffi.string(p3) == "wprld"
             if retry_counter == 1:
                 # the registered callbacks are removed
                 # on abort