Optimize memory usage
This commit is contained in:
parent
27b1042959
commit
9fcbdbab25
|
|
@ -149,6 +149,7 @@ struct ModuleCache
|
||||||
DSymbol* cacheModule(string location)
|
DSymbol* cacheModule(string location)
|
||||||
{
|
{
|
||||||
import std.stdio : File;
|
import std.stdio : File;
|
||||||
|
import core.memory: GC;
|
||||||
|
|
||||||
assert (location !is null);
|
assert (location !is null);
|
||||||
|
|
||||||
|
|
@ -160,6 +161,8 @@ struct ModuleCache
|
||||||
if (!needsReparsing(cachedLocation))
|
if (!needsReparsing(cachedLocation))
|
||||||
return getEntryFor(cachedLocation).symbol;
|
return getEntryFor(cachedLocation).symbol;
|
||||||
|
|
||||||
|
scope(exit) GC.collect();
|
||||||
|
|
||||||
recursionGuard.insert(&cachedLocation.data[0]);
|
recursionGuard.insert(&cachedLocation.data[0]);
|
||||||
|
|
||||||
File f = File(cachedLocation);
|
File f = File(cachedLocation);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue