mirror of
https://github.com/gperftools/gperftools
synced 2025-02-28 01:50:28 +00:00
prevent inlining in heap-checker unittest
The test relies on stuff "mmaper" function not being inlined, but compilers are getting smarter and latest clang actually does inline it now. Adding volatile to pointer declaration fixes it.
This commit is contained in:
parent
e521472f1a
commit
98ccd0f102
@ -1298,7 +1298,7 @@ static inline uintptr_t GetFunctionAddress (void* (*func)(uintptr_t*))
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
// to trick complier into preventing inlining
|
// to trick complier into preventing inlining
|
||||||
static void* (*mmapper_addr)(uintptr_t* addr) = &Mmapper;
|
static void* (* volatile mmapper_addr)(uintptr_t* addr) = &Mmapper;
|
||||||
|
|
||||||
// TODO(maxim): copy/move this to memory_region_map_unittest
|
// TODO(maxim): copy/move this to memory_region_map_unittest
|
||||||
// TODO(maxim): expand this test to include mmap64, mremap and sbrk calls.
|
// TODO(maxim): expand this test to include mmap64, mremap and sbrk calls.
|
||||||
|
Loading…
Reference in New Issue
Block a user