Memory Management in D: Request for Comment

dsimcha dsimcha at yahoo.com
Tue Nov 3 06:23:57 PST 2009


== Quote from downs (default_357-line at yahoo.de)'s article
> I submitted a patch a while back for constant-time removeRange. Can we dredge
that one up and/or implement something similar? It's rather useful for things like
stackthreads that need to add and remove lots of ranges :)
> (Search the NG for "Feature req.+Patch: O(1) removeRange")

I guess removeRange is currently O(N)?  I haven't looked.  Anyhow, I think the
bigger problem in practice, i.e. until N is unrealistically large, is that
removeRange requires taking a lock.  O(1) would be nice, though.

What does StackThreads (I assume this is equivalent to fibers) do that it requires
so many add/remove ranges?



More information about the Digitalmars-d mailing list