gecko/js
Nicholas Nethercote fc41c3c0c1 Bug 1039965 (attempt 2) - Avoid slop in JS arrays. r=bhackett,terrence.
This patch changes JS array resizing to prefer power-of-two sized slot
requests. Previously it would mostly make slightly-more-than-power-of-two sized
requests that cause lots of slop.

Also, shrinkElements() now only does a reallocation if it would result in going
down a size class. E.g. if you pop all the elements from a 1000-element array,
it would realloc 999, then 998, then 997, all the way down the minimum size.
Now it does 512, then 256, down to the minimum size (which is 8).

I confirmed with DMD that the element allocations now have zero slop. This
reduces peak RSS loading a couple of large PDF files (four times each) with
pdf.js by 10s of MiBs.

--HG--
extra : rebase_source : c10fd4efd8ab80df5bbe14815009edb8eed3f23f
2014-07-24 18:41:09 -07:00
..
ductwork/debugger Bug 914753: Make Emacs file variable header lines correct, or at least consistent. DONTBUILD r=ehsan 2014-06-24 22:12:07 -07:00
examples Bug 914753: Make Emacs file variable header lines correct, or at least consistent. DONTBUILD r=ehsan 2014-06-24 22:12:07 -07:00
ipc Bug 950745 - Flag when we're processing urgent messages and disallow certain activities (r=bsmedberg,luke) 2014-07-17 21:09:45 -07:00
public Bug 1031529 part 2 - Remove JS_THREADSAFE #ifdefs everywhere. r=bhackett 2014-07-24 11:56:43 +02:00
src Bug 1039965 (attempt 2) - Avoid slop in JS arrays. r=bhackett,terrence. 2014-07-24 18:41:09 -07:00
xpconnect Bug 1031529 part 3 - Step defining JS_THREADSAFE, remove --disable-threadsafe. r=glandium 2014-07-24 11:56:45 +02:00