History

Various perf and style fixes

arr committed 9 years ago

Commit 08c36e01 parent b1b22c24 files · +29 −23Browse files

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

Unified · Split

src/vm/list.cpp+7−5
@@ -45,10 +45,6 @@ vm_list_t::vm_list_t(std::shared_ptr<const type_descriptor_t> td, vm_list_t *tai · 44 unmodified lines
4545
4646 vm_list_t::~vm_list_t()
4747 {
48− // Remove tail
49− dec_ref_count_and_free(_tail);
50− debug::assign_debug_pointer(&_tail);
51−
5248 // Destroy and free the list element, if default element size was surpassed.
5349 if (_is_alloc)
5450 {
@@ -61,7 +57,13 @@ vm_list_t::~vm_list_t() · 6 unmodified lines
6157 }
6258
6359 debug::assign_debug_pointer(&_mem.alloc);
64− disvm::debug::log_msg(component_trace_t::memory, log_level_t::debug, "destroy: vm list");
60+
61+ // Remove tail
62+ dec_ref_count_and_free(_tail);
63+ debug::assign_debug_pointer(&_tail);
64+
65+ if (disvm::debug::is_component_tracing_enabled<component_trace_t::memory>())
66+ disvm::debug::log_msg(component_trace_t::memory, log_level_t::debug, "destroy: vm list");
6567 }
6668
6769 std::shared_ptr<const type_descriptor_t> vm_list_t::get_element_type() const