Bug 100437 - SymbolTableIndexHashTraits::needsDestruction should be set to true
Summary: SymbolTableIndexHashTraits::needsDestruction should be set to true
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: JavaScriptCore (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P2 Normal
Assignee: Michael Saboff
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2012-10-25 17:16 PDT by Michael Saboff
Modified: 2012-10-26 09:21 PDT (History)
1 user (show)

See Also:


Attachments
Patch (1.47 KB, patch)
2012-10-25 17:32 PDT, Michael Saboff
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Michael Saboff 2012-10-25 17:16:12 PDT
Due to the use of allocated rare data (FatEntry's) in SymbolTableEntry's, the hash trait needsDestruction should be set to true.  The code is currently working due to the Key trait, HashTraits<RefPtr<StringImpl> > having needsDestruction set true.  If the key or it's trait is set to false, then this would leak memory.
Comment 1 Michael Saboff 2012-10-25 17:17:07 PDT
<rdar://problem/12350394>
Comment 2 Michael Saboff 2012-10-25 17:32:34 PDT
Created attachment 170771 [details]
Patch
Comment 3 Mark Hahnenberg 2012-10-25 17:36:17 PDT
Comment on attachment 170771 [details]
Patch

r=me
Comment 4 WebKit Review Bot 2012-10-25 20:28:45 PDT
Comment on attachment 170771 [details]
Patch

Clearing flags on attachment: 170771

Committed r132566: <http://trac.webkit.org/changeset/132566>
Comment 5 WebKit Review Bot 2012-10-25 20:28:48 PDT
All reviewed patches have been landed.  Closing bug.
Comment 6 Darin Adler 2012-10-26 09:21:14 PDT
Comment on attachment 170771 [details]
Patch

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

> Source/JavaScriptCore/runtime/SymbolTable.h:340
> -        static const bool needsDestruction = false;
> +        static const bool needsDestruction = true;

A simpler correct fix is to simply remove this line entirely. It is true by default for structs, so no need to explicitly set it to true.