[Webkit-unassigned] [Bug 91214] [EFL] Add WebMemorySampler feature.

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Sat Aug 25 22:44:48 PDT 2012


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





--- Comment #28 from Raphael Kubo da Costa (rakuco) <rakuco at webkit.org>  2012-08-25 22:44:49 PST ---
(From update of attachment 160467)
View in context: https://bugs.webkit.org/attachment.cgi?id=160467&action=review

The current code is *very* JSC and Linux-specific. The JSC part cannot be easily solved, so you need to build all this only if JSC is being used instead of V8. For the Linux part, you need to either wrap your code within #if OS(LINUX) ifdefs or only build/call this at all if you are on Linux.

> Source/WebKit2/Shared/efl/WebMemorySamplerEfl.cpp:34
> +#include <malloc.h>

This is *very* deprecated, and you don't seem to allocate memory with malloc(3) and friends at all.

> Source/WebKit2/Shared/efl/WebMemorySamplerEfl.cpp:64
> +    memset(buffer, 0, maxBuffer);

Please include string.h for memset(3).

> Source/WebKit2/Shared/efl/WebMemorySamplerEfl.cpp:65
> +    fscanf(file, "%s", buffer);

And stdio.h for fscanf(3).

> Source/WebKit2/Shared/efl/WebMemorySamplerEfl.cpp:129
> +    size_t totalBytesInUse = 0, totalBytesCommitted = 0;

One variable per line, please.

> Source/WebKit2/UIProcess/API/efl/ewk_view.cpp:748
> +#if ENABLE(MEMORY_SAMPLER)
> +    static bool memorySampler = false;
> +    static const char environMemorySampler[] = "MEMORY_SAMPLER";
> +
> +    if (!memorySampler && getenv(environMemorySampler)) {
> +        WKRetainPtr<WKDoubleRef> interval(AdoptWK, WKDoubleCreate(0.0));
> +        WKContextStartMemorySampler(ewk_context_WKContext_get(context), interval.get());
> +        memorySampler = true;
> +    }
> +#endif

Why all this instead of using the existing infrastructure for enabling and starting the memory sampler?

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