• R/O
  • SSH

quipu: 提交

quipu mercurial repository


Commit MetaInfo

修訂143c56bc3cde16bf38f1ce2bfb1ed3178bbdda05 (tree)
時間2019-02-13 04:52:52
作者Agustina Arzille <avarzille@rise...>
CommiterAgustina Arzille

Log Message

Small changes in tuples

Change Summary

差異

diff -r 204b01d6c267 -r 143c56bc3cde tuple.cpp
--- a/tuple.cpp Fri Feb 08 18:31:01 2019 -0300
+++ b/tuple.cpp Tue Feb 12 16:52:52 2019 -0300
@@ -270,13 +270,12 @@
270270 if (outp)
271271 *outp = ap.pred;
272272
273-retry:
274273 for (int lvl = tp->hi_water - 1; lvl >= 0; --lvl)
275274 {
276275 if ((ap.next = node_next (ap.pred, lvl)) == UNBOUND && lvl >= n)
277276 continue;
278277 else if (ap.next & EXTRA_BIT)
279- goto retry;
278+ return (find_preds_mt (interp, tp, ap, n, key, unlink, outp));
280279
281280 for (ap.item = ap.next; ap.item != UNBOUND; )
282281 {
@@ -299,7 +298,8 @@
299298 else
300299 {
301300 if (ap.other & EXTRA_BIT)
302- goto retry;
301+ return (find_preds_mt (interp,
302+ tp, ap, n, key, unlink, outp));
303303
304304 ap.item = ap.other;
305305 }
@@ -325,7 +325,7 @@
325325 ap.l_succs[lvl] = ap.item;
326326 }
327327
328- return (d == 0 && ap.item != UNBOUND ? ap.item : UNBOUND);
328+ return (d == 0 ? ap.item : UNBOUND);
329329 }
330330
331331 static inline object
@@ -366,14 +366,12 @@
366366 object nval = make_node (interp, n, key);
367367 f.call (interp, node_key (nval));
368368
369- ap.next = node_next (nval, 0) = *ap.l_succs;
370- for (int lvl = 1; lvl < n; ++lvl)
371- node_next(nval, lvl) = ap.l_succs[lvl];
369+ copy_objs (&node_next(nval, 0), ap.l_succs, n);
372370
373371 ap.pred = *ap.l_preds;
374372 /* Try to link the new element bottom-up. If we manage to
375373 * do so, it becomes part of the tuple. */
376- if (!atomic_cas_bool ((atomic_t *)&node_next(ap.pred, 0), ap.next, nval))
374+ if (!atomic_cas_bool ((atomic_t *)&node_next(ap.pred, 0), *ap.l_succs, nval))
377375 // Another thread beat us - Retry.
378376 goto retry;
379377
Show on old repository browser