mirror of
https://github.com/holub/mame
synced 2025-07-04 17:38:08 +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
|
DEFS += -DUSE_SYSTEM_JPEGLIB
|
||||||
endif
|
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
|
// add a new entry
|
||||||
memory_entry::allocate(size, result, file, line);
|
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);
|
memset(result, 0xdd, size);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -174,7 +174,7 @@ void *malloc_array_file_line(size_t size, const char *file, int line)
|
|||||||
// add a new entry
|
// add a new entry
|
||||||
memory_entry::allocate(size, result, file, line);
|
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);
|
memset(result, 0xdd, size);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user