| 322 | const void* RawPtr() const override { return &value; } |
| 323 | |
| 324 | ValueInterface* Clone() const override { |
| 325 | // NOTE: Use placement new here because we override `operator delete`, |
| 326 | // and need to match the call to `port::Free()` with a call to |
| 327 | // `port::Malloc()`. |
| 328 | auto* clone = static_cast<Value*>(port::Malloc(sizeof(Value))); |
| 329 | new (clone) Value(kInPlace, value); |
| 330 | return clone; |
| 331 | } |
| 332 | |
| 333 | void MoveAssign(ValueInterface* memory) override { |
| 334 | CHECK(TypeId() == memory->TypeId()) |