aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/sdlang/libinputvisitor
diff options
context:
space:
mode:
Diffstat (limited to 'src/sdlang/libinputvisitor')
-rw-r--r--src/sdlang/libinputvisitor/libInputVisitor.d26
1 files changed, 24 insertions, 2 deletions
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);
+ }
}