We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents df43527 + 5b54ef3 commit be54421Copy full SHA for be54421
1 file changed
src/Allocs.jl
@@ -141,9 +141,17 @@ function pprof(alloc_profile::Profile.Allocs.AllocResults = Profile.Allocs.fetch
141
end
142
143
144
+ type_name_cache = Dict{Any,String}()
145
+
146
+ function get_type_name(type::Any)
147
+ return get!(type_name_cache, type) do
148
+ return "Alloc: $(type)"
149
+ end
150
151
152
function construct_location_for_type(typename)
153
# TODO: Lol something less hacky than this:
- return maybe_add_location(StackFrame("Alloc: $(typename)", "nothing", 0))
154
+ return maybe_add_location(StackFrame(get_type_name(typename), "nothing", 0))
155
156
157
for sample in alloc_profile.allocs # convert the sample.stack to vector of location_ids
0 commit comments