[Webkit-unassigned] [Bug 88344] Fix FastMalloc.cpp compile error for MSVC in 64-bit

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Tue Jun 12 11:52:34 PDT 2012


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





--- Comment #8 from Alex Christensen <alex.christensen at flexsim.com>  2012-06-12 11:52:33 PST ---
The preprocessor cannot use the sizeof operator.  Since this would add a maximum of 64 bytes per TCMalloc_Central_FreeListPadded and there is only an array of kNumClasses of these objects, and kNumClasses is 68, this would use a maximum of 4420 bytes.  I don't think this is anything to worry about.

Commit it!

(In reply to comment #7)
> (From update of attachment 145851 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=145851&action=review
> 
> >> Source/WTF/wtf/FastMalloc.cpp:2477
> >>   private:
> >> -  char pad_[(64 - (sizeof(TCMalloc_Central_FreeList) % 64)) % 64];
> >> +    char pad[64 - (sizeof(TCMalloc_Central_FreeList) % 64)];
> > 
> > Clearly, whoever wrote this code didn't test it :(
> 
> On my second thought you should wrap this with
> #if sizeof(TCMalloc_Central_FreeList) % 64
> #endif
> so that we don't increase the size when sizeof(TCMalloc_Central_FreeList) is a multiple of 64.

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