Bug 1810 – MmFile anonymous mapping does not work under win32

Status
RESOLVED
Resolution
FIXED
Severity
major
Priority
P3
Component
phobos
Product
D
Version
D2
Platform
x86
OS
All
Creation time
2008-01-30T13:50:00Z
Last change time
2015-06-09T01:31:19Z
Keywords
patch
Assigned to
bugzilla
Creator
default_357-line

Attachments

IDFilenameSummaryContent-TypeSize
224anonymous_mmap_fix.patchAdd code to handle the filename=null casetext/plain1487
225mmfile_win32_fix.patchAdded code to handle a null hFile in the destructortext/plain1744

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
Comment #3 by bugzilla — 2008-03-07T00:27:15Z
Fixed dmd 1.028 and 2.012