History

Move some basic offset functions to header files for inlining ease Replace enum_pointer_field functions with custom implementations - GC now has custom implementation - other implementations use template<> version Fix misuse of shared_ptr<type_descriptor_t> in various built-in types Observed 5 - 8 % improvement in GC for compiler scenario.

arr committed 9 years ago

Commit cd2748b1 parent 3dd1c8210 files · +115 −160Browse files

Showing the changes to src/exec/debugger.cpp (1 of 10 files). Show all

Unified · Split

src/exec/debugger.cpp+5−3
@@ -339,14 +339,16 @@ namespace · 338 unmodified lines
339339 {
340340 ss << alloc->alloc_type << " - alloc" << dbg_alloc;
341341
342− enum_pointer_fields_with_offset(*alloc->alloc_type, alloc->get_allocation(), [&ss, recurse_depth](pointer_t p, std::size_t o)
342+ const auto base_address = reinterpret_cast<std::uintptr_t>(alloc->get_allocation());
343+ enum_pointer_fields(*alloc->alloc_type, alloc->get_allocation(), [&ss, recurse_depth, base_address](pointer_t *p)
343344 {
344345 ss << "\n";
345346 std::fill_n(std::ostream_iterator<std::ostream::char_type>{ ss }, 4 * recurse_depth, ' ');
346− ss << "[" << o << "] ";
347+ const auto p_address = reinterpret_cast<std::uintptr_t>(p);
348+ ss << "[" << std::size_t{ p_address - base_address } << "] ";
347349
348350 if (recurse_depth < 2)
349− safe_alloc_print(ss, vm_alloc_t::from_allocation(p), recurse_depth + 1);
351+ safe_alloc_print(ss, vm_alloc_t::from_allocation(*p), recurse_depth + 1);
350352 else
351353 ss << "...";
352354 });