Thread overview
[Issue 14810] std.mmfile should only return a shared!T object
Jul 21, 2015
Jonathan M Davis
Dec 17, 2022
Iain Buclaw
July 21, 2015
https://issues.dlang.org/show_bug.cgi?id=14810

Jonathan M Davis <issues.dlang@jmdavisProg.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |issues.dlang@jmdavisProg.co
                   |                            |m

--- Comment #1 from Jonathan M Davis <issues.dlang@jmdavisProg.com> ---
Last time I was looking at this, I came to the conclusion that if we wanted std.mmfile.MmFile to be @safe, what really needed to happen was that rather than returning an array from opSlice, it would need to return a reference-counted object that ensured that the memory wasn't unmapped until there were no more references to it floating around. And there's a decent chance that MmFile should have been a struct rather than a class (which seems to be what you're arguing for, but you talk about std.mmfile returning stuff, which doesn't make sense, since it's a module), but I'd have to look at it again to decide what my take on that would be at this point.

Regardless, std.mmfile could use some redesign. It's looks like it comes from D1 originally, so it predates ranges and @safe and all of that kind of fun stuff. So, while it's useful, it isn't really designed in the way that we'd design it now.

--
December 17, 2022
https://issues.dlang.org/show_bug.cgi?id=14810

Iain Buclaw <ibuclaw@gdcproject.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Priority|P1                          |P4

--
December 01
https://issues.dlang.org/show_bug.cgi?id=14810

--- Comment #2 from dlangBugzillaToGithub <robert.schadek@posteo.de> ---
THIS ISSUE HAS BEEN MOVED TO GITHUB

https://github.com/dlang/phobos/issues/10136

DO NOT COMMENT HERE ANYMORE, NOBODY WILL SEE IT, THIS ISSUE HAS BEEN MOVED TO GITHUB

--