예제 #1
0
inline oid_t dense_bin_fun::value (oid_t i, oid_t j) const
{
    POMAGMA_ASSERT_RANGE_(5, i, item_dim());
    POMAGMA_ASSERT_RANGE_(5, j, item_dim());

    const oid_t * block = _block(i / ITEMS_PER_BLOCK, j / ITEMS_PER_BLOCK);
    return _block2value(block, i & BLOCK_POS_MASK, j & BLOCK_POS_MASK);
}
예제 #2
0
void NullaryFunction::unsafe_merge (Ob dep)
{
    UniqueLock lock(m_mutex);

    Ob rep = m_carrier.find(dep);
    POMAGMA_ASSERT4(rep < dep, "bad merge: " << dep << "," << rep);
    POMAGMA_ASSERT_RANGE_(4, dep, support().item_dim());
    POMAGMA_ASSERT_RANGE_(4, rep, support().item_dim());

    if (m_value == dep) {
        m_value = rep;
    }
}
예제 #3
0
파일: carrier.hpp 프로젝트: fritzo/pomagma
inline bool Carrier::set_and_merge(std::atomic<Ob>& destin, Ob source) const {
    POMAGMA_ASSERT_RANGE_(5, source, item_dim());

    Ob old = 0;
    while (not destin.compare_exchange_strong(
        old, source, std::memory_order_acq_rel, std::memory_order_acquire)) {
        source = ensure_equal(source, old);
        if (old == source) return false;
    }
    return old == 0;
}
예제 #4
0
파일: carrier.hpp 프로젝트: fritzo/pomagma
inline bool Carrier::set_or_merge(std::atomic<Ob>& destin, Ob source) const {
    POMAGMA_ASSERT_RANGE_(5, source, item_dim());

    Ob old = 0;
    if (destin.compare_exchange_strong(old, source, std::memory_order_acq_rel,
                                       std::memory_order_acquire)) {
        return true;
    } else {
        ensure_equal(source, old);
        return false;
    }
}
예제 #5
0
 bool_ref Rx (Ob lhs, Ob rhs)
 {
     POMAGMA_ASSERT_RANGE_(5, lhs, item_dim());
     return bool_ref::index(Rx(rhs), lhs);
 }
예제 #6
0
 bool_ref Lx (Ob lhs, Ob rhs)
 {
     POMAGMA_ASSERT_RANGE_(5, rhs, item_dim());
     return bool_ref::index(Lx(lhs), rhs);
 }
예제 #7
0
 std::atomic<Word> * Rx (Ob rhs)
 {
     POMAGMA_ASSERT_RANGE_(5, rhs, item_dim());
     return m_Rx_lines + (rhs * m_round_word_dim);
 }
예제 #8
0
 std::atomic<Word> * Lx (Ob lhs)
 {
     POMAGMA_ASSERT_RANGE_(5, lhs, item_dim());
     return m_Lx_lines + (lhs * m_round_word_dim);
 }
예제 #9
0
inline bool dense_set::_bit (size_t i) const
{
    POMAGMA_ASSERT_RANGE_(5, i, m_item_dim);
    return bool_ref::index(m_words, i);
}