Added code to handle a null hFile in the destructor
text/plain
1744
Comments
Comment #0 by default_357-line — 2008-01-30T13:50:06Z
Sample code:
import std.mmfile, std.stdio;
void main() {
auto test = new MmFile(null, MmFile.Mode.ReadWriteNew, 1024*1024, null);
writefln("Done");
}
The problem:
"Error: : The system cannot find the path specified."
It looks like the MmFile code tries to open the null as a file and fails; however, the spec says that null as a filename creates an anonymous mapping.
Reference: http://digitalmars.com/d/1.0/phobos/std_mmfile.html
Since my StackThreads implementation relies on memory-mapped files for stack memory, this completely breaks my code under win32. A solution would be greatly appreciated.
--downs
Comment #1 by default_357-line — 2008-01-31T20:00:14Z
Created attachment 224
Add code to handle the filename=null case
Comment #2 by default_357-line — 2008-02-05T20:06:36Z
Created attachment 225
Added code to handle a null hFile in the destructor