[Webkit-unassigned] [Bug 68434] [GTK] Implement cache model for WebKit2

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Fri Sep 23 00:49:18 PDT 2011


https://bugs.webkit.org/show_bug.cgi?id=68434





--- Comment #7 from Carlos Garcia Campos <cgarcia at igalia.com>  2011-09-23 00:49:19 PST ---
(In reply to comment #5)
> (From update of attachment 108325 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=108325&action=review
> 
> > Source/WebKit2/WebProcess/gtk/WebProcessGtk.cpp:71
> > +    guint64 totalMem = g_ascii_strtoull(ptr + strlen("MemTotal:"), &endPtr, 10);
> 
> Could we have strlen("MemTotal:") precalculated in a static variable?

This code will usually be executed only once to set the cache model, so I don't think we need micro-optimizations here, but if you think it's worh it I don't mind to do it.

> Maybe we could even use sysconf with _SC_PHYS_PAGES and _SC_PAGE_SIZE, it could be cleaner.

__get_phys_pages() (called by sysconf to get _SC_PHYS_PAGES) parses /proc/meminfo to get the total mem, and returns total_mem / (__getpagesize () / 1024). We are doing the same, but getting the value directly. I agree using sysconf might be cleaner, though

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the webkit-unassigned mailing list