[Issue 4412] Array capacity growth spikey and the ratio approaches 1.0

d-bugmail at puremagic.com d-bugmail at puremagic.com
Wed Jul 14 05:29:37 PDT 2010


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


Fawzi Mohamed <fawzi at gmx.ch> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |fawzi at gmx.ch


--- Comment #7 from Fawzi Mohamed <fawzi at gmx.ch> 2010-07-14 05:29:31 PDT ---
When this issue was discovered in tango I invested some time thinking about it.
What I came out with is
  http://github.com/fawzi/blip/blob/master/blip/util/Grow.d
a version of which I had also used in tango.

Looking again at it I think that I decided to grow based on memory usage, and
give "extra" space to arrays with large elements just using rounding up.
Particularly with 32-bit one should be aware that some calculation in extreme
cases could overflow.

I release the growing code with whatever license needed.

-- 
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