cleaner way of disabling memory initialization with MemorySanitizer (nw)

This commit is contained in:
Oliver Stöneberg 2013-06-25 12:18:05 +00:00
parent 8c066a99e7
commit 6faeb5b078
2 changed files with 2 additions and 8 deletions

View File

@ -440,12 +440,6 @@ ifneq ($(BUILD_JPEGLIB),1)
DEFS += -DUSE_SYSTEM_JPEGLIB
endif
# disable initialization of memory in malloc overload
ifdef SANITIZE
ifneq (,$(findstring memory,$(SANITIZE)))
DEFS += -DNO_MEMORY_INITIALIZATION
endif
endif
#-------------------------------------------------

View File

@ -150,7 +150,7 @@ void *malloc_file_line(size_t size, const char *file, int line)
// add a new entry
memory_entry::allocate(size, result, file, line);
#if !defined(NO_MEMORY_INITIALIZATION) && defined(MAME_DEBUG)
#if !defined(__has_feature) && !__has_feature(memory_sanitizer) && defined(MAME_DEBUG)
memset(result, 0xdd, size);
#endif
@ -174,7 +174,7 @@ void *malloc_array_file_line(size_t size, const char *file, int line)
// add a new entry
memory_entry::allocate(size, result, file, line);
#if !defined(NO_MEMORY_INITIALIZATION) && defined(MAME_DEBUG)
#if !defined(__has_feature) && !__has_feature(memory_sanitizer) && defined(MAME_DEBUG)
memset(result, 0xdd, size);
#endif