Skip to content

Commit

Permalink
[runtime] Fixed Valgrind support to compile against Win64.
Browse files Browse the repository at this point in the history
  • Loading branch information
tritao committed Aug 17, 2015
1 parent 7c07d1d commit 1747c03
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 2 deletions.
2 changes: 2 additions & 0 deletions mono/mini/mini-runtime.c
Expand Up @@ -119,12 +119,14 @@ static void register_icalls (void);
gboolean
mono_running_on_valgrind (void)
{
#ifndef HOST_WIN32
if (RUNNING_ON_VALGRIND){
#ifdef VALGRIND_JIT_REGISTER_MAP
valgrind_register = TRUE;
#endif
return TRUE;
} else
#endif
return FALSE;
}

Expand Down
5 changes: 5 additions & 0 deletions mono/mini/tramp-amd64.c
Expand Up @@ -148,6 +148,11 @@ mono_arch_get_llvm_imt_trampoline (MonoDomain *domain, MonoMethod *m, int vt_off
return start;
}

#ifdef _WIN64
// Workaround lack of Valgrind support for 64-bit Windows
#define VALGRIND_DISCARD_TRANSLATIONS(...)
#endif

/*
* mono_arch_patch_callsite:
*
Expand Down
2 changes: 1 addition & 1 deletion mono/sgen/sgen-gc.c
Expand Up @@ -822,7 +822,7 @@ sgen_conservatively_pin_objects_from (void **start, void **end, void *start_nurs
{
int count = 0;

#ifdef VALGRIND_MAKE_MEM_DEFINED_IF_ADDRESSABLE
#if defined(VALGRIND_MAKE_MEM_DEFINED_IF_ADDRESSABLE) && !defined(_WIN64)
VALGRIND_MAKE_MEM_DEFINED_IF_ADDRESSABLE (start, (char*)end - (char*)start);
#endif

Expand Down
2 changes: 1 addition & 1 deletion mono/utils/valgrind.h
Expand Up @@ -451,7 +451,7 @@ typedef

#if defined(PLAT_amd64_win64) && !defined(__GNUC__)

#error Unsupported compiler.
//#error Unsupported compiler.

#endif /* PLAT_amd64_win64 */

Expand Down

0 comments on commit 1747c03

Please sign in to comment.