Bug 204384 - [JSC] Work-around Leaks' false-positive report about memory leaking
Summary: [JSC] Work-around Leaks' false-positive report about memory leaking
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: Yusuke Suzuki
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2019-11-19 15:56 PST by Yusuke Suzuki
Modified: 2019-11-19 16:56 PST (History)
2 users (show)

See Also:


Attachments
Patch (3.08 KB, patch)
2019-11-19 16:00 PST, Yusuke Suzuki
mark.lam: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Yusuke Suzuki 2019-11-19 15:56:46 PST
[JSC] Work-around Leaks' false-positive report about memory leaking
Comment 1 Yusuke Suzuki 2019-11-19 16:00:19 PST
Created attachment 383915 [details]
Patch
Comment 2 Yusuke Suzuki 2019-11-19 16:00:21 PST
<rdar://problem/56950932>
Comment 3 Mark Lam 2019-11-19 16:04:01 PST
Comment on attachment 383915 [details]
Patch

r=me
Comment 4 Mark Lam 2019-11-19 16:05:41 PST
Comment on attachment 383915 [details]
Patch

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

> Source/JavaScriptCore/jit/ExecutableAllocator.cpp:425
> -    g_jscConfig.fixedVMPoolExecutableAllocator = new FixedVMPoolExecutableAllocator();
> +    auto* allocator = new FixedVMPoolExecutableAllocator();
> +    g_jscConfig.fixedVMPoolExecutableAllocator = allocator;
> +    globalFixedVMPoolExecutableAllocatorToWorkAroundLeaks = allocator;

You could just implement this as:
    g_jscConfig.fixedVMPoolExecutableAllocator = new FixedVMPoolExecutableAllocator();
    globalFixedVMPoolExecutableAllocatorToWorkAroundLeaks = g_jscConfig.fixedVMPoolExecutableAllocator;

That way, there's only a 1 line change that is easier to undo later.

> Source/JavaScriptCore/jit/ExecutableAllocator.cpp:657
> -    g_jscConfig.executableAllocator = new ExecutableAllocator;
> +    auto* allocator = new ExecutableAllocator;
> +    g_jscConfig.executableAllocator = allocator;
> +    globalExecutableAllocatorToWorkAroundLeaks = allocator;

Ditto.
Comment 5 Yusuke Suzuki 2019-11-19 16:55:57 PST
Comment on attachment 383915 [details]
Patch

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

>> Source/JavaScriptCore/jit/ExecutableAllocator.cpp:425
>> +    globalFixedVMPoolExecutableAllocatorToWorkAroundLeaks = allocator;
> 
> You could just implement this as:
>     g_jscConfig.fixedVMPoolExecutableAllocator = new FixedVMPoolExecutableAllocator();
>     globalFixedVMPoolExecutableAllocatorToWorkAroundLeaks = g_jscConfig.fixedVMPoolExecutableAllocator;
> 
> That way, there's only a 1 line change that is easier to undo later.

Nice, fixed.

>> Source/JavaScriptCore/jit/ExecutableAllocator.cpp:657
>> +    globalExecutableAllocatorToWorkAroundLeaks = allocator;
> 
> Ditto.

Fixed.
Comment 6 Yusuke Suzuki 2019-11-19 16:56:55 PST
Committed r252661: <https://trac.webkit.org/changeset/252661>