mirror of
https://github.com/holub/mame
synced 2025-04-19 23:12:11 +03:00
cleaner way of disabling memory initialization with MemorySanitizer (nw)
This commit is contained in:
parent
8c066a99e7
commit
6faeb5b078
6
makefile
6
makefile
@ -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
|
||||
|
||||
|
||||
#-------------------------------------------------
|
||||
|
@ -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
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user