aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/sdlang/libinputvisitor/libInputVisitor.d
diff options
context:
space:
mode:
authorRalph Amissah <ralph@amissah.com>2016-10-01 13:54:14 -0400
committerRalph Amissah <ralph@amissah.com>2019-04-10 15:14:13 -0400
commit1cc6a04b8bce82fa83b62d919bf8bdf14cad0b92 (patch)
treed8c44fa4acb7f588640b2be4117e26bbb864221c /src/sdlang/libinputvisitor/libInputVisitor.d
parentheader, body split a more reliable regex solution (diff)
update sdlang, start looking to using dub remote dependenciesdoc-reform_v0.0.6
Diffstat (limited to 'src/sdlang/libinputvisitor/libInputVisitor.d')
-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);
+ }
}