Randomness in built-in .sort

dsimcha dsimcha at yahoo.com
Mon Jan 5 08:07:12 PST 2009


== Quote from Don (nospam at nospam.com)'s article
> I want TempAlloc in dcore! Eventually, anyway.

The only problem is that, in its current form, TempAlloc is kind of dangerous
because it puts the onus on the programmer to not store the only reference to a
reference type in a TempAlloc-allocated block.  If TempAlloc were more tightly
integrated with the GC, this could be solved easily with negligible overhead.  One
would simply have to keep a thread-local variable that tracks how many blocks are
currently in use, kind of like the stack pointer in the call stack, and a bit
array that tracks whether each block that is currently in use should be scanned.
However, without GC integration, just making everything scanned would cause so
many false pointer issues and slowdowns when GC is run that I decided that, for
now, given the anticipated use cases, making it a little dangerous and scanning
nothing was the lesser of two evils.



More information about the Digitalmars-d mailing list