Demo entry 6741839

a

   

Submitted by anonymous on May 16, 2018 at 16:26
Language: C++. Code size: 958 Bytes.

// Region状态定义
static const char skippable_bit = 1 << 0;
static const char partial_bit   = 1 << 1;
static const char extend_bit    = 1 << 2;
static const char overflow_bit  = 1 << 3;

// Region状态查询接口
inline bool ParallelCompactData::RegionData::is_skippable() const {
    return _status & skippable_bit;
}

inline bool ParallelCompactData::RegionData::is_partial() const {
    return _status & partial_bit;
}

inline bool ParallelCompactData::RegionData::is_extending() const {
    return _status & extend_bit;
}

inline bool ParallelCompactData::RegionData::is_overflowed() const {
    return _status & overflow_bit;
}

inline char ParallelCompactData::RegionData::get_status() const {
    return _status;
}

// Region状态设置与移除接口
inline void ParallelCompactData::RegionData::set_status(char status) {
    _status |= status;
}

inline void ParallelCompactData::RegionData::remove_status(char status) {
    _status &= ~status;
}

This snippet took 0.01 seconds to highlight.

Back to the Entry List or Home.

Delete this entry (admin only).