@@ -13,7 +13,7 @@ const ExtendedEntryObj = Union{
13
13
# matches RawAllocResults on the C side
14
14
struct RawAllocProfile
15
15
alloc_types:: Vector{Ptr{Type}}
16
- alloc_sizes:: Vector{Csize_t}
16
+ alloc_sizes:: Vector{Ptr{ Csize_t} }
17
17
alloc_bts:: Vector{Vector{Ptr{Cvoid}}}
18
18
alloc_bt2s:: Vector{Vector{ExtendedEntryObj}}
19
19
@@ -135,15 +135,21 @@ function decode(raw_results::RawAllocProfile)::AllocResults
135
135
cache = BacktraceCache ()
136
136
allocs = Vector {Alloc} ()
137
137
138
- @assert length (raw_results. alloc_bts) == length (raw_results. alloc_bt2s) == length (raw_results. alloc_types)
138
+ @assert length (raw_results. alloc_bts) ==
139
+ length (raw_results. alloc_bt2s) ==
140
+ length (raw_results. alloc_types) ==
141
+ length (raw_results. alloc_sizes)
139
142
140
143
for i in 1 : length (raw_results. alloc_bts)
141
144
bt = raw_results. alloc_bts[i]
142
145
bt2 = raw_results. alloc_bt2s[i]
143
- type = load_type (raw_results. alloc_types[i])
146
+ type_tag = raw_results. alloc_types[i]
147
+ size = ccall (:jl_unbox_uint64 , UInt64, (Ptr{Csize_t},), raw_results. alloc_sizes[i])
148
+
149
+ type = load_type (type_tag)
144
150
back_trace = _reformat_bt_custom (bt, bt2)
145
151
stack_trace = stacktrace_memoized (cache, back_trace)
146
- size = 5 # TODO : grab this
152
+
147
153
push! (allocs, Alloc (
148
154
type,
149
155
stack_trace,
0 commit comments