Skip to content

Commit

Permalink
point out types that have an unmanaged_data func
Browse files Browse the repository at this point in the history
those all have some extra data they "own", like
an array or a hash for example.
  • Loading branch information
timo committed Sep 12, 2018
1 parent e7d52c7 commit 74ccfc3
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/profiler/instrument.c
Expand Up @@ -340,6 +340,7 @@ typedef struct {
MVMString *thread;
MVMString *native_lib;
MVMString *managed_size;
MVMString *has_unmanaged_data;
} ProfDumpStrs;

typedef struct {
Expand Down Expand Up @@ -490,6 +491,8 @@ static MVMObject * dump_call_graph_node(MVMThreadContext *tc, ProfDumpStrs *pds,

if (type_info) {
MVM_repr_bind_key_o(tc, type_info, pds->managed_size, box_i(tc, STABLE(type)->size));
if (REPR(type)->unmanaged_size)
MVM_repr_bind_key_o(tc, type_info, pds->has_unmanaged_data, box_i(tc, 1));
MVM_repr_bind_key_o(tc, type_info, pds->type, type);
}

Expand Down Expand Up @@ -625,6 +628,8 @@ void MVM_profile_dump_instrumented_data(MVMThreadContext *tc) {
pds.native_lib = str(tc, "native library");
pds.managed_size = str(tc, "managed_size");

pds.has_unmanaged_data = str(tc, "has_unmanaged_data");

types_array = new_array(tc);

MVM_repr_push_o(tc, tc->prof_data->collected_data, types_array);
Expand Down

0 comments on commit 74ccfc3

Please sign in to comment.