return;
pin_stats_tree_free (node->left);
pin_stats_tree_free (node->right);
- free_internal_mem (node, INTERNAL_MEM_STATISTICS);
+ mono_sgen_free_internal_dynamic (node, sizeof (PinStatAddress), INTERNAL_MEM_STATISTICS);
}
static void
pinned_byte_counts [i] = 0;
while (pinned_objects) {
ObjectList *next = pinned_objects->next;
- free_internal_mem (pinned_objects, INTERNAL_MEM_STATISTICS);
+ mono_sgen_free_internal_dynamic (pinned_objects, sizeof (ObjectList), INTERNAL_MEM_STATISTICS);
pinned_objects = next;
}
}
node_ptr = &node->right;
}
- node = get_internal_mem (sizeof (PinStatAddress), INTERNAL_MEM_STATISTICS);
+ node = mono_sgen_alloc_internal_dynamic (sizeof (PinStatAddress), INTERNAL_MEM_STATISTICS);
node->addr = addr;
node->pin_types = pin_type_bit;
node->left = node->right = NULL;
pin_stats_count_object_from_tree (obj, size, node->right, pin_types);
}
-static void
-pin_stats_register_object (char *obj, size_t size)
+void
+mono_sgen_pin_stats_register_object (char *obj, size_t size)
{
int pin_types = 0;
- ObjectList *list = get_internal_mem (sizeof (ObjectList), INTERNAL_MEM_STATISTICS);
+ ObjectList *list;
+
+ if (!heap_dump_file)
+ return;
+
+ list = mono_sgen_alloc_internal_dynamic (sizeof (ObjectList), INTERNAL_MEM_STATISTICS);
pin_stats_count_object_from_tree (obj, size, pin_stat_addresses, &pin_types);
list->obj = (MonoObject*)obj;
list->next = pinned_objects;