Bug 141472

Summary: bmalloc buildfix on 32 bit Linux (x86/ARM)
Product: WebKit Reporter: Csaba Osztrogonác <ossy>
Component: New BugsAssignee: Csaba Osztrogonác <ossy>
Status: RESOLVED FIXED    
Severity: Blocker CC: cgarcia, clopez, commit-queue, ggaren, gyuyoung.kim, ossy
Priority: P1    
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Bug Depends on:    
Bug Blocks: 140162    
Attachments:
Description Flags
Patch
none
Patch none

Description Csaba Osztrogonác 2015-02-11 05:54:57 PST
bmalloc buildfix on 32 bit Linux (x86/ARM)
Comment 1 Csaba Osztrogonác 2015-02-11 05:56:14 PST
Created attachment 246386 [details]
Patch
Comment 2 Csaba Osztrogonác 2015-02-11 05:58:17 PST
Comment on attachment 246386 [details]
Patch

It works on 32 bit, but breaks the 64 bit :-/
Comment 3 Csaba Osztrogonác 2015-02-11 06:04:11 PST
Comment on attachment 246386 [details]
Patch

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

> Source/bmalloc/bmalloc/FixedVector.h:62
> -    void clear() { shrink(0ul); }
> +    void clear() { shrink(0u); }

The original 0ul fails on 32bit:
../../Source/bmalloc/bmalloc/FixedVector.h: In instantiation of 'void bmalloc::FixedVector<T, Capacity>::clear() [with T = void*; unsigned int Capacity = 256u]':
../../Source/bmalloc/bmalloc/Deallocator.cpp:91:23:   required from here
../../Source/bmalloc/bmalloc/FixedVector.h:62:30: error: call of overloaded 'shrink(long unsigned int)' is ambiguous
../../Source/bmalloc/bmalloc/FixedVector.h:62:30: note: candidates are:
../../Source/bmalloc/bmalloc/FixedVector.h:112:13: note: void bmalloc::FixedVector<T, Capacity>::shrink(T*) [with T = void*; unsigned int Capacity = 256u]
../../Source/bmalloc/bmalloc/FixedVector.h:105:13: note: void bmalloc::FixedVector<T, Capacity>::shrink(size_t) [with T = void*; unsigned int Capacity = 256u; size_t = unsigned int]

The modified 0u fails on 64 bit:
./../Source/bmalloc/bmalloc/FixedVector.h: In instantiation of 'void bmalloc::FixedVector<T, Capacity>::clear() [with T = void*; long unsigned int Capacity = 256ul]':
../../Source/bmalloc/bmalloc/Deallocator.cpp:91:23:   required from here
../../Source/bmalloc/bmalloc/FixedVector.h:62:29: error: call of overloaded 'shrink(unsigned int)' is ambiguous
../../Source/bmalloc/bmalloc/FixedVector.h:62:29: note: candidates are:
../../Source/bmalloc/bmalloc/FixedVector.h:112:13: note: void bmalloc::FixedVector<T, Capacity>::shrink(T*) [with T = void*; long unsigned int Capacity = 256ul]
../../Source/bmalloc/bmalloc/FixedVector.h:105:13: note: void bmalloc::FixedVector<T, Capacity>::shrink(size_t) [with T = void*; long unsigned int Capacity = 256ul; size_t = long unsigned int]
Comment 4 Csaba Osztrogonác 2015-02-11 06:13:10 PST
Created attachment 246387 [details]
Patch

try to make 32 and 64 bit happy in the same time
Comment 5 Gyuyoung Kim 2015-02-11 07:26:46 PST
Comment on attachment 246387 [details]
Patch

rs=me. I think this patch isn't change behavior.
Comment 6 Gyuyoung Kim 2015-02-11 07:34:45 PST
(In reply to comment #5)
> Comment on attachment 246387 [details]
> Patch
> 
> rs=me. I think this patch isn't change behavior.

typo: s/isn't/doesn't/g
Comment 7 WebKit Commit Bot 2015-02-11 08:12:15 PST
Comment on attachment 246387 [details]
Patch

Clearing flags on attachment: 246387

Committed r179927: <http://trac.webkit.org/changeset/179927>
Comment 8 WebKit Commit Bot 2015-02-11 08:12:20 PST
All reviewed patches have been landed.  Closing bug.