From 1cc6a04b8bce82fa83b62d919bf8bdf14cad0b92 Mon Sep 17 00:00:00 2001 From: Ralph Amissah Date: Sat, 1 Oct 2016 13:54:14 -0400 Subject: update sdlang, start looking to using dub remote dependencies --- src/sdlang/libinputvisitor/libInputVisitor.d | 26 ++++++++++++++++++++++++-- 1 file changed, 24 insertions(+), 2 deletions(-) (limited to 'src/sdlang/libinputvisitor') diff --git a/src/sdlang/libinputvisitor/libInputVisitor.d b/src/sdlang/libinputvisitor/libInputVisitor.d index 15c2ce8..f29dc4f 100644 --- a/src/sdlang/libinputvisitor/libInputVisitor.d +++ b/src/sdlang/libinputvisitor/libInputVisitor.d @@ -38,7 +38,24 @@ class InputVisitor(Obj, Elem) : Fiber this(Obj obj) { this.obj = obj; - super(&run); + + version(Windows) // Issue #1 + { + import core.sys.windows.windows : SYSTEM_INFO, GetSystemInfo; + SYSTEM_INFO info; + GetSystemInfo(&info); + auto PAGESIZE = info.dwPageSize; + + super(&run, PAGESIZE * 16); + } + else + super(&run); + } + + this(Obj obj, size_t stackSize) + { + this.obj = obj; + super(&run, stackSize); } private void run() @@ -56,7 +73,7 @@ class InputVisitor(Obj, Elem) : Fiber } // Member 'front' must be a function due to DMD Issue #5403 - private Elem _front; + private Elem _front = Elem.init; // Default initing here avoids "Error: field _front must be initialized in constructor" @property Elem front() { ensureStarted(); @@ -88,4 +105,9 @@ template inputVisitor(Elem) { return new InputVisitor!(Obj, Elem)(obj); } + + @property InputVisitor!(Obj, Elem) inputVisitor(Obj)(Obj obj, size_t stackSize) + { + return new InputVisitor!(Obj, Elem)(obj, stackSize); + } } -- cgit v1.2.3