Skip to content

Commit

Permalink
Optimize memory usage
Browse files Browse the repository at this point in the history
  • Loading branch information
ryuukk authored Aug 27, 2024
1 parent 27b1042 commit 9fcbdba
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions dsymbol/src/dsymbol/modulecache.d
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,7 @@ struct ModuleCache
DSymbol* cacheModule(string location)
{
import std.stdio : File;
import core.memory: GC;

assert (location !is null);

Expand All @@ -160,6 +161,8 @@ struct ModuleCache
if (!needsReparsing(cachedLocation))
return getEntryFor(cachedLocation).symbol;

scope(exit) GC.collect();

recursionGuard.insert(&cachedLocation.data[0]);

File f = File(cachedLocation);
Expand Down

0 comments on commit 9fcbdba

Please sign in to comment.