Showing the changes to src/vm/vm_memory.cpp (1 of 17 files). Show all
Unified · Split
| @@ -283,7 +283,12 @@ vm_alloc_t::vm_alloc_t(std::shared_ptr<const type_descriptor_t> td) · 282 unmodified lines | |||
| 283 | 283 | ||
| 284 | vm_alloc_t::~vm_alloc_t() | 284 | vm_alloc_t::~vm_alloc_t() |
| 285 | { | 285 | { |
| 286 | assert(_ref_count == 0); | 286 | #ifndef NDEBUG |
| 287 | if (_ref_count != 0) | ||
| 288 | debug::log_msg(debug::component_trace_t::memory, debug::log_level_t::warning, | ||
| 289 | "vm alloc being destroy with non-zero reference count. " | ||
| 290 | "This could be okay if this is happening due to frame unwinding from an exception"); | ||
| 291 | #endif | ||
| 287 | 292 | ||
| 288 | auto finalizer = alloc_type->finalizer; | 293 | auto finalizer = alloc_type->finalizer; |
| 289 | if (finalizer != type_descriptor_t::no_finalizer) | 294 | if (finalizer != type_descriptor_t::no_finalizer) |
| @@ -291,7 +296,9 @@ vm_alloc_t::~vm_alloc_t() · 1 unmodified line | |||
| 291 | 296 | ||
| 292 | // Free pointer types | 297 | // Free pointer types |
| 293 | destroy_memory(*alloc_type, get_allocation()); | 298 | destroy_memory(*alloc_type, get_allocation()); |
| 294 | debug::log_msg(debug::component_trace_t::memory, debug::log_level_t::debug, "destroy: vm alloc"); | 299 | |
| 300 | if (debug::is_component_tracing_enabled<debug::component_trace_t::memory>()) | ||
| 301 | debug::log_msg(debug::component_trace_t::memory, debug::log_level_t::debug, "destroy: vm alloc"); | ||
| 295 | } | 302 | } |
| 296 | 303 | ||
| 297 | std::size_t vm_alloc_t::add_ref() | 304 | std::size_t vm_alloc_t::add_ref() |