History

Create configuration struct for VM Add syscall failure exception - Create VM syscall failure message functions Respect the 'r' format verb Create module resolver interface Implement default module resolver interface Implement Sys.fildes() function

arr committed 9 years ago

Commit 232a6591 parent eb06d3d17 files · +416 −124Browse files

Showing the changes to src/vm/vm_memory.cpp (1 of 17 files). Show all

Unified · Split

src/vm/vm_memory.cpp+9−2
@@ -283,7 +283,12 @@ vm_alloc_t::vm_alloc_t(std::shared_ptr<const type_descriptor_t> td) · 282 unmodified lines
283 283
284vm_alloc_t::~vm_alloc_t()284vm_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 types297 // 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
297std::size_t vm_alloc_t::add_ref()304std::size_t vm_alloc_t::add_ref()