X-Git-Url: http://wien.tomnetworks.com/gitweb/?a=blobdiff_plain;f=mono%2Fmetadata%2Fsgen-new-bridge.c;h=501ceb76d5b8c5a987d26b28891e01ca701cdb53;hb=3fd54893bc792eee42164bfb605b418105a92f92;hp=4631c0c5430f2ec946931fee01fee5ae079a6ad7;hpb=df867664eec6ac0aa851004db0a7cb94ba381602;p=mono.git diff --git a/mono/metadata/sgen-new-bridge.c b/mono/metadata/sgen-new-bridge.c index 4631c0c5430..501ceb76d5b 100644 --- a/mono/metadata/sgen-new-bridge.c +++ b/mono/metadata/sgen-new-bridge.c @@ -101,6 +101,8 @@ typedef struct _SCC { #endif } SCC; +static char *dump_prefix = NULL; + // Maps managed objects to corresponding HashEntry stricts static SgenHashTable hash_table = SGEN_HASH_TABLE_INIT (INTERNAL_MEM_BRIDGE_HASH_TABLE, INTERNAL_MEM_BRIDGE_HASH_TABLE_ENTRY, sizeof (HashEntry), mono_aligned_addr_hash, NULL); @@ -161,11 +163,16 @@ dyn_array_int_contains (DynIntArray *da, int x) #endif static void -enable_accounting (void) +set_config (const SgenBridgeProcessorConfig *config) { - SgenHashTable table = SGEN_HASH_TABLE_INIT (INTERNAL_MEM_BRIDGE_HASH_TABLE, INTERNAL_MEM_BRIDGE_HASH_TABLE_ENTRY, sizeof (HashEntryWithAccounting), mono_aligned_addr_hash, NULL); - bridge_accounting_enabled = TRUE; - hash_table = table; + if (config->accounting) { + SgenHashTable table = SGEN_HASH_TABLE_INIT (INTERNAL_MEM_BRIDGE_HASH_TABLE, INTERNAL_MEM_BRIDGE_HASH_TABLE_ENTRY, sizeof (HashEntryWithAccounting), mono_aligned_addr_hash, NULL); + bridge_accounting_enabled = TRUE; + hash_table = table; + } + if (config->dump_prefix) { + dump_prefix = strdup (config->dump_prefix); + } } static MonoGCBridgeObjectKind @@ -604,8 +611,6 @@ reset_flags (SCC *scc) } #endif -static char *dump_prefix = NULL; - static void dump_graph (void) { @@ -657,12 +662,6 @@ dump_graph (void) fclose (file); } -static void -set_dump_prefix (const char *prefix) -{ - dump_prefix = strdup (prefix); -} - static int compare_hash_entries (const HashEntry *e1, const HashEntry *e2) { @@ -1087,8 +1086,7 @@ sgen_new_bridge_init (SgenBridgeProcessor *collector) collector->class_kind = class_kind; collector->register_finalized_object = register_finalized_object; collector->describe_pointer = describe_pointer; - collector->enable_accounting = enable_accounting; - collector->set_dump_prefix = set_dump_prefix; + collector->set_config = set_config; bridge_processor = collector; }