Bug 49637
Summary: | JSC::UString and WTF::String should use size_t instead of unsigned | ||
---|---|---|---|
Product: | WebKit | Reporter: | David Kilzer (:ddkilzer) <ddkilzer> |
Component: | JavaScriptCore | Assignee: | Nobody <webkit-unassigned> |
Status: | NEW | ||
Severity: | Normal | CC: | barraclough, cevans, darin, ggaren, mjs |
Priority: | P2 | Keywords: | InRadar |
Version: | 528+ (Nightly build) | ||
Hardware: | All | ||
OS: | All | ||
Bug Depends on: | 34952 | ||
Bug Blocks: |
David Kilzer (:ddkilzer)
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.
Attachments | ||
---|---|---|
Add attachment proposed patch, testcase, etc. |
David Kilzer (:ddkilzer)
<rdar://problem/5861044>
Darin Adler
I suspect this will make every string object a bit larger on 64-bit systems. Do the benefits outweigh that cost?
Chris Evans
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.