Bug 196963 - [WTF] Generic memoryFootprint() implementation should use bmalloc on Linux
Summary: [WTF] Generic memoryFootprint() implementation should use bmalloc on Linux
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: New Bugs (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Zan Dobersek
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2019-04-16 01:42 PDT by Zan Dobersek
Modified: 2019-04-21 23:24 PDT (History)
5 users (show)

See Also:


Attachments
Patch (2.33 KB, patch)
2019-04-16 02:42 PDT, Zan Dobersek
don.olmstead: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Zan Dobersek 2019-04-16 01:42:35 PDT
[WTF] Generic memoryFootprint() implementation should use bmalloc on Linux
Comment 1 Zan Dobersek 2019-04-16 02:42:59 PDT
Created attachment 367519 [details]
Patch
Comment 2 Don Olmstead 2019-04-16 09:02:45 PDT
Comment on attachment 367519 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=367519&action=review

r=me with nits

> Source/WTF/wtf/generic/MemoryFootprintGeneric.cpp:29
> +#if !(defined(USE_SYSTEM_MALLOC) && USE_SYSTEM_MALLOC) && OS(LINUX)

Remove OS(LINUX) there's no reason for this to be OS specific.

> Source/WTF/wtf/generic/MemoryFootprintGeneric.cpp:37
> +#if !(defined(USE_SYSTEM_MALLOC) && USE_SYSTEM_MALLOC) && OS(LINUX)

Same
Comment 3 Zan Dobersek 2019-04-17 01:01:18 PDT
Comment on attachment 367519 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=367519&action=review

>> Source/WTF/wtf/generic/MemoryFootprintGeneric.cpp:29
>> +#if !(defined(USE_SYSTEM_MALLOC) && USE_SYSTEM_MALLOC) && OS(LINUX)
> 
> Remove OS(LINUX) there's no reason for this to be OS specific.

Didn't mention it in ChangeLog when I should have, but this bmalloc API at the moment is only implemented and exposed on Linux and iOS platforms. Given this implementation of WTF::memoryFootprint() would be used only on Linux (iOS has a different one), the OS(LINUX) guard is used here.

The PlayStation port also uses this implementation, but I'm not sure whether bmalloc is used there and/or if the underlying OS identifies as Linux-like to the point of being able to use the bmalloc implementation.
Comment 4 Basuke Suzuki 2019-04-17 12:23:55 PDT
Comment on attachment 367519 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=367519&action=review

>>> Source/WTF/wtf/generic/MemoryFootprintGeneric.cpp:29
>>> +#if !(defined(USE_SYSTEM_MALLOC) && USE_SYSTEM_MALLOC) && OS(LINUX)
>> 
>> Remove OS(LINUX) there's no reason for this to be OS specific.
> 
> Didn't mention it in ChangeLog when I should have, but this bmalloc API at the moment is only implemented and exposed on Linux and iOS platforms. Given this implementation of WTF::memoryFootprint() would be used only on Linux (iOS has a different one), the OS(LINUX) guard is used here.
> 
> The PlayStation port also uses this implementation, but I'm not sure whether bmalloc is used there and/or if the underlying OS identifies as Linux-like to the point of being able to use the bmalloc implementation.

We use bmalloc, but we didn't follow memoryFootprint() API yet. We'll see how we can do that and enable here also after doing that.
Comment 5 Zan Dobersek 2019-04-21 23:23:02 PDT
Committed r244496: <https://trac.webkit.org/changeset/244496>
Comment 6 Radar WebKit Bug Importer 2019-04-21 23:24:24 PDT
<rdar://problem/50087037>