GC hax
This commit is contained in:
parent
30c8134b93
commit
ebe56f3e56
|
@ -1230,6 +1230,7 @@ size_t[] chooseLineBreakTokens(size_t index, const Token[] tokens,
|
||||||
{
|
{
|
||||||
import std.container.rbtree : RedBlackTree;
|
import std.container.rbtree : RedBlackTree;
|
||||||
import std.algorithm : min;
|
import std.algorithm : min;
|
||||||
|
import core.memory : GC;
|
||||||
|
|
||||||
enum ALGORITHMIC_COMPLEXITY_SUCKS = 20;
|
enum ALGORITHMIC_COMPLEXITY_SUCKS = 20;
|
||||||
immutable size_t tokensEnd = min(tokens.length, ALGORITHMIC_COMPLEXITY_SUCKS);
|
immutable size_t tokensEnd = min(tokens.length, ALGORITHMIC_COMPLEXITY_SUCKS);
|
||||||
|
@ -1237,6 +1238,8 @@ size_t[] chooseLineBreakTokens(size_t index, const Token[] tokens,
|
||||||
auto open = new RedBlackTree!State;
|
auto open = new RedBlackTree!State;
|
||||||
open.insert(State(cast(size_t[])[], tokens[0 .. tokensEnd], depth, formatterConfig,
|
open.insert(State(cast(size_t[])[], tokens[0 .. tokensEnd], depth, formatterConfig,
|
||||||
currentLineLength, indentLevel));
|
currentLineLength, indentLevel));
|
||||||
|
GC.disable();
|
||||||
|
scope(exit) GC.enable();
|
||||||
while (!open.empty)
|
while (!open.empty)
|
||||||
{
|
{
|
||||||
State current = open.front();
|
State current = open.front();
|
||||||
|
|
Loading…
Reference in New Issue