Phobos addition formal review: std.experimental.allocator

Alex Parrill via Digitalmars-d digitalmars-d at puremagic.com
Fri Jun 26 07:51:43 PDT 2015


The Windows MMap allocator only keeps one HANDLE around, and 
creates a new one on each `allocate`. Thus, `deallocate` closes 
the latest handle, regardless of what it was actually passed, so 
it leaks.

If I'm reading the docs for `CreateFileMapping` right, you should 
be able to close the handle after calling `MapViewOfFile`; the 
internal data will persist until you unmap the memory region.


More information about the Digitalmars-d mailing list