void* Nullcline::DataCopy() const { #ifdef DEBUG_FUNC ScopeTracker st("Nullcline::DataCopy", std::this_thread::get_id()); #endif std::lock_guard<std::mutex> lock( Mutex() ); if (!ConstData()) return nullptr; return new Record(*static_cast<const Record*>( ConstData() )); }
// Check whether the other ByteArray is equal to this. bool ByteArray::Equal(const ByteArray &other) const { if (Length() != other.Length()) { return false; } if (Length() == 0 && other.Length() == 0) { // If both are empty, ensure that they are either // both null, or both non-null. return IsNull() == other.IsNull(); } if (memcmp(ConstData(), other.ConstData(), Length()) == 0) { return true; } return false; }
SSATmp* TraceBuilder::genDefNone() { return gen(DefConst, Type::None, ConstData(0)); }
SSATmp* TraceBuilder::genPtrToUninit() { return gen(DefConst, Type::PtrToInitNull, ConstData(&init_null_variant)); }
SSATmp* TraceBuilder::genDefNull() { return gen(DefConst, Type::Null, ConstData(0)); }
SSATmp* TraceBuilder::genDefUninit() { return gen(DefConst, Type::Uninit, ConstData(0)); }
TEST( ConstDataTest, ConstDataReturns3 ) { EXPECT_EQ( ConstData(), 3 ); }