Summary: std.file.read on OSX: "Memory allocation failed"
OS/Version: Mac OS X
In almost all cases, calling std.file.read a second time I throws a "Memory
Allocation Failed" error and the program exits. This simple program (that
prints itself) fails on my OS X machine at the second call to read.
import std.file : read;
import std.stdio : writeln;
int main(string args)
writeln(read(__FILE__)); // works
writeln(read(__FILE__)); // error
Debugging a little, I find that "fstat64(fd, &statbuf)" returns an gigantic
file size (more than 1 Go), which then gets passed to GC.malloc. So it seems
that fstat64 doesn't work correctly on Mac OS X, or more likely the layout of
struct_stat64 may be different on Mac OS X and this has not been taken into
account in the declaration.
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------