RESOLVED FIXED 48484
Improve memSize calculation in [WebView _setCacheModel]
https://bugs.webkit.org/show_bug.cgi?id=48484
Summary Improve memSize calculation in [WebView _setCacheModel]
Pratik Solanki
Reported 2010-10-27 16:39:35 PDT
In [WebView _setCacheModel], we use a fudge factor for the memory size // As a fudge factor, use 1000 instead of 1024, in case the reported byte // count doesn't align exactly to a megabyte boundary. uint64_t memSize = WebMemorySize() / 1024 / 1000; Instead of doing that, we should just round up the memSize to a multiple of 2 and update the code to check for 4MB/2MB/1MB/512KB memory levels.
Attachments
Patch (3.72 KB, patch)
2010-10-27 17:16 PDT, Pratik Solanki
no flags
Pratik Solanki
Comment 1 2010-10-27 17:16:25 PDT
Darin Adler
Comment 2 2010-10-27 17:23:27 PDT
Comment on attachment 72118 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=72118&action=review Changes look fine. I have a comment or two, but nothing we couldn’t tweak later. > WebKit/mac/WebView/WebView.mm:5324 > + static uint64_t memSize = roundUpToPowerOf2(WebMemorySize() / 1024 / 1024); Is it really worthwhile to store this in a global? Paying 8 bytes of global memory to avoid doing this math more than once might be the wrong tradeoff since we do this computation only when the cache model is changed.
WebKit Commit Bot
Comment 3 2010-10-27 17:42:45 PDT
Comment on attachment 72118 [details] Patch Clearing flags on attachment: 72118 Committed r70732: <http://trac.webkit.org/changeset/70732>
WebKit Commit Bot
Comment 4 2010-10-27 17:42:50 PDT
All reviewed patches have been landed. Closing bug.
Note You need to log in before you can comment on or make changes to this bug.