Thread overview
[Issue 4151] New: Add weak references to Phobos/druntime
May 03, 2010
nfxjfg@gmail.com
Jan 07, 2011
nfxjfg@gmail.com
Jan 07, 2011
Brad Roberts
Mar 16, 2013
Denis Shelomovskij
Oct 08, 2013
Denis Shelomovskij
Oct 16, 2013
Denis Shelomovskij
May 03, 2010
http://d.puremagic.com/issues/show_bug.cgi?id=4151

           Summary: Add weak references to Phobos/druntime
           Product: D
           Version: future
          Platform: Other
        OS/Version: All
            Status: NEW
          Severity: enhancement
          Priority: P2
         Component: Phobos
        AssignedTo: nobody@puremagic.com
        ReportedBy: nfxjfg@gmail.com


--- Comment #0 from nfxjfg@gmail.com 2010-05-02 20:55:00 PDT ---
Just that.

The Java API documentation may provide a good starting point as to what weak references should be able to do: http://java.sun.com/javase/7/docs/api/java/lang/ref/WeakReference.html

Note that finalizers and the "hidden" rt_attach.../detach... functions are highly unsafe and hard to get right. As an example what can go wrong if users try to implement their own weak references, see bug 4150.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
January 07, 2011
http://d.puremagic.com/issues/show_bug.cgi?id=4151


nfxjfg@gmail.com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |INVALID


-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
January 07, 2011
http://d.puremagic.com/issues/show_bug.cgi?id=4151


Brad Roberts <braddr@puremagic.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|RESOLVED                    |REOPENED
                 CC|                            |braddr@puremagic.com
         Resolution|INVALID                     |


-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
March 16, 2013
http://d.puremagic.com/issues/show_bug.cgi?id=4151


Denis Shelomovskij <verylonglogin.reg@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |verylonglogin.reg@gmail.com


--- Comment #1 from Denis Shelomovskij <verylonglogin.reg@gmail.com> 2013-03-16 15:06:59 MSK ---
Even worse GC lock/unlock aren't parts of a druntime user API so one have to use ugly things like calling addRange/removeRange to ensure the memory will not be collected.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
October 08, 2013
http://d.puremagic.com/issues/show_bug.cgi?id=4151



--- Comment #2 from Denis Shelomovskij <verylonglogin.reg@gmail.com> 2013-10-08 13:58:32 MSD ---
One can use this implementation for now: http://denis-sh.bitbucket.org/unstandard/unstd.memory.weakref.html

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
October 16, 2013
http://d.puremagic.com/issues/show_bug.cgi?id=4151



--- Comment #3 from Denis Shelomovskij <verylonglogin.reg@gmail.com> 2013-10-16 13:58:28 MSD ---
A proposal to add library implementation without runtime changes: http://forum.dlang.org/thread/l3dj7b$2tvc$1@digitalmars.com

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------