Exemple #1
0
    REALM_FORCEINLINE T get_next(size_t index)
    {
#ifdef _MSC_VER
#pragma warning(push)
#pragma warning(disable:4800)   // Disable the Microsoft warning about bool performance issue.
#endif

        cache_next(index);
        T av = m_leaf_ptr->get(index - m_leaf_start);
        return av;

#ifdef _MSC_VER
#pragma warning(pop)
#endif
    }
Exemple #2
0
struct bucket_t *cache_t::find(cache_key_t key)
{
    assert(key != 0);

    bucket_t *b = buckets();
    mask_t m = mask();
    mask_t begin = cache_hash(key, m);
    mask_t i = begin;
    do {
        if (b[i].key() == 0  ||  b[i].key() == key) {
            return &b[i];
        }
    } while ((i = cache_next(i, m)) != begin);
    return nullptr;
}