Bug 49637 - JSC::UString and WTF::String should use size_t instead of unsigned
Summary: JSC::UString and WTF::String should use size_t instead of unsigned
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: JavaScriptCore (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P2 Normal
Assignee: Nobody
URL:
Keywords: InRadar
Depends on: 34952
Blocks:
  Show dependency treegraph
 
Reported: 2010-11-16 18:06 PST by David Kilzer (:ddkilzer)
Modified: 2010-11-17 23:11 PST (History)
5 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description David Kilzer (:ddkilzer) 2010-11-16 18:06:57 PST
JSC::UString and WTF::String should use size_t instead of unsigned since unsigned is only 4 bytes on 64-bit, but size_t is 8 bytes.
Comment 1 David Kilzer (:ddkilzer) 2010-11-16 18:07:21 PST
<rdar://problem/5861044>
Comment 2 Darin Adler 2010-11-16 18:11:09 PST
I suspect this will make every string object a bit larger on 64-bit systems. Do the benefits outweigh that cost?
Comment 3 Chris Evans 2010-11-17 23:11:25 PST
The current use of "unsigned" even on 64-bit seems very deliberate:

StringImpl.cpp:COMPILE_ASSERT(sizeof(StringImpl) == 2 * sizeof(int) + 3 * sizeof(void*), StringImpl_should_stay_small);


Given that we're careful to not truncate lengths, I see costs but not many benefits.