Bug 43619

Summary: Bitmap.h has no default constructor
Product: WebKit Reporter: Zoltan Herczeg <zherczeg>
Component: JavaScriptCoreAssignee: Nobody <webkit-unassigned>
Severity: Normal CC: abecsi, ademar, ossy, yael
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: PC   
OS: OS X 10.5   
Bug Depends on:    
Bug Blocks: 41177    
Description Flags
ggaren: review-
patch v2 eric: review+

Description Zoltan Herczeg 2010-08-06 05:57:15 PDT
The bitmap array is not cleared, and contains a memory garbage after init.
Comment 1 Zoltan Herczeg 2010-08-06 07:11:43 PDT
Created attachment 63718 [details]
Comment 2 Geoffrey Garen 2010-08-06 10:45:37 PDT
Comment on attachment 63718 [details]

Nice catch.

 +      Bitmap(bool initializationNeeded = true);
WebKit is moving toward a policy of considering boolean arguments to functions to be a bad design pattern. I think we may eventually discourage or forbid them in our coding style guidelines. The problem with this kind of argument is that it's very hard to tell, at the callsite, exactly what "true" or "false" might mean.

I think you should just remove the boolean argument here.

If we do want to take advantage of an optimized "no initialization" bitmap in the future, let's add an extra constructor akin to the AdoptCFTag constructor for RetainPtr, or the VPtrStealingHackType constructor for JSString.

Otherwise, this patch is great!
Comment 3 Zoltan Herczeg 2010-08-06 12:04:47 PDT
Created attachment 63748 [details]
patch v2
Comment 4 Eric Seidel (no email) 2010-08-06 13:31:05 PDT
Comment on attachment 63748 [details]
patch v2

Comment 5 Zoltan Herczeg 2010-08-07 10:37:35 PDT
Landed in http://trac.webkit.org/changeset/64912
Closing bug.
Comment 6 Yael 2010-12-02 12:21:45 PST
This is the fix I was about to suggest for https://qtrequirements.europe.nokia.com/browse/BR-4872, just to find that it was already fixed. :-(
Comment 7 Ademar Reis 2010-12-02 12:47:18 PST
Revision r64912 cherry-picked into qtwebkit-2.1 with commit 67daffa <http://gitorious.org/webkit/qtwebkit/commit/67daffa>