[Issue 7251] GC not working

d-bugmail at puremagic.com d-bugmail at puremagic.com
Sun Mar 4 09:53:06 PST 2012


http://d.puremagic.com/issues/show_bug.cgi?id=7251


Rob Jacques <sandford at jhu.edu> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Priority|P2                          |P4
                 CC|                            |sandford at jhu.edu
           Platform|x86                         |All
         OS/Version|Windows                     |All
           Severity|regression                  |minor


--- Comment #7 from Rob Jacques <sandford at jhu.edu> 2012-03-04 09:53:01 PST ---
(In reply to comment #6)
> (In reply to comment #5)
> > No, it's inevitable that a mark-and-sweep GC on a 32 bit system won't work if
> > large numbers of false pointers are present. And this code:
> > 
> >    foreach (i; 0 .. count)
> >         a ~= i;
> > 
> > is flooding the system with false pointers.
> 
> I think you might have misunderstood the problem, like I originally did.
> 
> I am **********  NOT  *********** filling the system with false pointers.
> See David Simcha's comment in response to mine:
> http://stackoverflow.com/a/8796226/541686
> 
> It's inherently defective -- I'm merely _allocating_ a lot of memory, that's
> all. The rest is a problem with the GC's algorithm.
> (Unless you expect that no one will allocate one 20-MB chunk of RAM?)

The static data segment and the stack generate _always_ contain false pointers.
So even if you're not generating them yourself much, they do exist and things
will get stuck. 

Also, direct use of ~= is discouraged; appender is recommended instead and
there  patch for appender that solves this issue.

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


More information about the Digitalmars-d-bugs mailing list