Finalizing D2

BCS none at anon.com
Sat May 23 11:02:24 PDT 2009


Hello Andrei,

> grauzone wrote:
> 
>>> Because the only way to make memory-mapped files safe is to have the
>>> GC handle them.
>>> 
>> Care to explain?
>> 
> mmhandle h = mapFile("test.txt");
> char[] x = cast(char[]) h.ptr;
> h.unmapFile;
> Any attempt to use x will crash the program. So it's the gc who needs
> to unmap files when they are no longer referenced.
> 

maybe normaly, but you need a way to backdoor this.





More information about the Digitalmars-d mailing list