qchbai / gperftools

Automatically exported from code.google.com/p/gperftools
BSD 3-Clause "New" or "Revised" License
0 stars 0 forks source link

[patch] Fix malloc_hook_test for PPC64 #446

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Current 'malloc_hook_test' does a cast from a function point 
(MallocHook::NewHook) to int in the form:

reinterpret_cast<const int&>(values_as_hooks[i]);

And where it usually works on 32-bits platforms and on some 64-bits one, the 
cast wrongly assumes sizeof(int) == sizeof(void*) and it might be evaluated to 
0 (as in case of GCC for PPC64).

The patch attached fixes it. Tested on i386, x86_64 and PPC64.

Original issue reported on code.google.com by zatr...@gmail.com on 11 Jul 2012 at 9:50

Attachments:

GoogleCodeExporter commented 9 years ago

------------------------------------------------------------------------
r158 | chappedm@gmail.com | 2012-09-17 21:43:02 -0400 (Mon, 17 Sep 2012) | 1 
line

issue-446: Fixes compatability issues in malloc_hook_test for PPC64
------------------------------------------------------------------------

Original comment by chapp...@gmail.com on 18 Sep 2012 at 2:24