From ebe56f3e5638f88f75b158b9e427ec78cafe2821 Mon Sep 17 00:00:00 2001 From: Hackerpilot Date: Thu, 19 Feb 2015 16:24:21 -0800 Subject: [PATCH] GC hax --- src/dfmt.d | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/dfmt.d b/src/dfmt.d index 719618a..0d4eaf1 100644 --- a/src/dfmt.d +++ b/src/dfmt.d @@ -1230,6 +1230,7 @@ size_t[] chooseLineBreakTokens(size_t index, const Token[] tokens, { import std.container.rbtree : RedBlackTree; import std.algorithm : min; + import core.memory : GC; enum ALGORITHMIC_COMPLEXITY_SUCKS = 20; 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; open.insert(State(cast(size_t[])[], tokens[0 .. tokensEnd], depth, formatterConfig, currentLineLength, indentLevel)); + GC.disable(); + scope(exit) GC.enable(); while (!open.empty) { State current = open.front();