Skip to content
This repository has been archived by the owner on Oct 12, 2022. It is now read-only.

Commit

Permalink
Simple multithreaded program + "-profile=gc" = crash
Browse files Browse the repository at this point in the history
Fixes issue 15947 (https://issues.dlang.org/show_bug.cgi?id=15947)
Fixes issue 14511 (https://issues.dlang.org/show_bug.cgi?id=14511)

Root problem was trying to increment non-existent AA field upon merging profile
stats. The code was also simplified to remove unnecessary condition.
  • Loading branch information
mihails-strasuns-sociomantic committed Apr 6, 2017
1 parent 644d6fb commit 08835c0
Showing 1 changed file with 6 additions and 10 deletions.
16 changes: 6 additions & 10 deletions src/rt/profilegc.d
Expand Up @@ -89,18 +89,14 @@ static ~this()
{
synchronized
{
if (globalNewCounts.length)
foreach (name, entry; newCounts)
{
// Merge
foreach (name, entry; newCounts)
{
globalNewCounts[name].count += entry.count;
globalNewCounts[name].size += entry.size;
}
if (!(name in globalNewCounts))
globalNewCounts[name] = Entry.init;

globalNewCounts[name].count += entry.count;
globalNewCounts[name].size += entry.size;
}
else
// Assign
globalNewCounts = newCounts;
}
newCounts = null;
}
Expand Down

0 comments on commit 08835c0

Please sign in to comment.