It seems like a possible cause of the bug you posted, since memory gets trashed 
by the inconsistent sizes it could manifest itself in several ways.  The 
quickest way to validate is probably to compile with the /vmg option which will 
prevent the issue from occurring in all cases (at the cost of un-optimal member 
function pointer sizes).

A few other techniques were brought to my attention which you may choose if you 
find that this is indeed the problem, the complete list now looks like:

·         Provide the definition of the class before declaring the member 
function pointer

·         decorate the forward declarations with the inheritance specifiers as 
described here: https://msdn.microsoft.com/en-us/library/ck561bfk.aspx

·         use the pointers_to_members pragma described here: 
https://msdn.microsoft.com/en-us/library/83cch5a6.aspx

·         use the /vmg compiler flag

Chris

From: Isaac Devine [mailto:is...@devinesystems.co.nz]
Sent: Wednesday, April 13, 2016 4:27 PM
To: Vienneau, Christopher <cvienn...@ea.com>
Cc: WebKit Development <webkit-dev@lists.webkit.org>
Subject: Re: [webkit-dev] Potential problem with member function pointer sizes

Hi Chris,

I wonder whether what you have reported would cause this issue:
https://bugs.webkit.org/show_bug.cgi?id=151162

Cheers,
Isaac

On 14 April 2016 at 09:17, Vienneau, Christopher 
<cvienn...@ea.com<mailto:cvienn...@ea.com>> wrote:
Hi,

I just wanted to give a heads up on an issue I recently investigated, the 
details can be seen in this forums post:
https://social.msdn.microsoft.com/Forums/vstudio/en-US/72343dd4-3a43-46e8-889e-73dc4d8e9432/discrepancy-with-sizeof-in-template?forum=vcgeneral
The short version is that the MSVC compiler will do the wrong then when making 
a member function pointer to a class that it only has a forward declaration 
for.  This can be fixed by either providing the definition for the class or by 
using the /vmg compiler flag.

I did not experience this problem with Apples WinCairo sample, but I suspect it 
could happen.

Chris Vienneau

_______________________________________________
webkit-dev mailing list
webkit-dev@lists.webkit.org<mailto:webkit-dev@lists.webkit.org>
https://lists.webkit.org/mailman/listinfo/webkit-dev

_______________________________________________
webkit-dev mailing list
webkit-dev@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-dev

Reply via email to