Showing the changes to src/vm/vm_memory.cpp (1 of 5 files). Show all
Unified · Split
| @@ -530,3 +530,19 @@ type_descriptor_t::type_descriptor_t( · 529 unmodified lines | ||
| 530 | 530 | if (debug::is_component_tracing_enabled<debug::component_trace_t::memory>()) |
| 531 | 531 | debug::log_msg(debug::component_trace_t::memory, debug::log_level_t::debug, "init: type descriptor"); |
| 532 | 532 | } |
| 533 | + | |
| 534 | +bool type_descriptor_t::is_equal(const type_descriptor_t *other) const | |
| 535 | +{ | |
| 536 | + if (other == nullptr) | |
| 537 | + return false; | |
| 538 | + | |
| 539 | + if (this == other) | |
| 540 | + return true; | |
| 541 | + | |
| 542 | + bool equal = size_in_bytes == other->size_in_bytes; | |
| 543 | + equal = equal && map_in_bytes == other->map_in_bytes; | |
| 544 | + equal = equal && 0 == std::memcmp(pointer_map, other->pointer_map, map_in_bytes); | |
| 545 | + equal = equal && finalizer == other->finalizer; | |
| 546 | + | |
| 547 | + return equal; | |
| 548 | +} | |