<html>
<head>
<base href="https://bugs.webkit.org/" />
</head>
<body><table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Bug ID</th>
<td><a class="bz_bug_link
bz_status_NEW "
title="NEW - SameSizeAs* structs wrongly assume sizeof(ptr)==sizeof(std::unique_ptr)"
href="https://bugs.webkit.org/show_bug.cgi?id=150235">150235</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>SameSizeAs* structs wrongly assume sizeof(ptr)==sizeof(std::unique_ptr)
</td>
</tr>
<tr>
<th>Classification</th>
<td>Unclassified
</td>
</tr>
<tr>
<th>Product</th>
<td>WebKit
</td>
</tr>
<tr>
<th>Version</th>
<td>WebKit Nightly Build
</td>
</tr>
<tr>
<th>Hardware</th>
<td>Unspecified
</td>
</tr>
<tr>
<th>OS</th>
<td>Unspecified
</td>
</tr>
<tr>
<th>Status</th>
<td>NEW
</td>
</tr>
<tr>
<th>Severity</th>
<td>Normal
</td>
</tr>
<tr>
<th>Priority</th>
<td>P2
</td>
</tr>
<tr>
<th>Component</th>
<td>WebCore Misc.
</td>
</tr>
<tr>
<th>Assignee</th>
<td>webkit-unassigned@lists.webkit.org
</td>
</tr>
<tr>
<th>Reporter</th>
<td>rupsharma@ea.com
</td>
</tr></table>
<p>
<div>
<pre>Hi,
In regard to all the static assertions, to check the sizes of the data-structures using SameSizeAs* structs, it is wrongly assumed, that sizeof (std::unique_ptr) is same as sizeof (pointer) for all compilers.
Therefore, I would suggest to list them separately while computing the sizes.
To give an example:
In WebCore\dom\ElementRareData.cpp
The structure should look like:
struct SameSizeAsElementRareData : NodeRareData {
short indices[2];
unsigned bitfields;
RegionOversetState regionOversetState;
LayoutSize sizeForResizing;
IntSize scrollOffset;
// CHANGE BEGINS HERE . Earlier it was :void* pointers[7];
void* pointers[4];
std::unique_ptr<DatasetDOMStringMap> pointer2;
std::unique_ptr<ClassList> pointer3;
std::unique_ptr<NamedNodeMap> pointer4;
// CHANGE ENDS HERE
};
Making the above change, works perfectly for us without throwing any compile-time assert at:
static_assert(sizeof(ElementRareData) == sizeof(SameSizeAsElementRareData), "ElementRareData should stay small");
Thanks,
Rupali</pre>
</div>
</p>
<hr>
<span>You are receiving this mail because:</span>
<ul>
<li>You are the assignee for the bug.</li>
</ul>
</body>
</html>