diff --git a/library/CMakeLists.txt b/library/CMakeLists.txt index f8b05a04c..d0410850c 100644 --- a/library/CMakeLists.txt +++ b/library/CMakeLists.txt @@ -6,7 +6,6 @@ OPTION(BUILD_DEVEL "Install/package files required for development (For SDK)." O OPTION(BUILD_DOXYGEN "Create/install/package doxygen documentation for DFHack (For SDK)." OFF) IF(UNIX) OPTION(CONSOLE_NO_CATCH "Make the console not catch 'CTRL+C' events for easier debugging." OFF) - OPTION(MALLOC_FILL "Make malloc calls fill the allocated memory with 0xCC values." OFF) ENDIF() include_directories (include) @@ -216,9 +215,6 @@ IF(UNIX) IF(CONSOLE_NO_CATCH) ADD_DEFINITIONS(-DCONSOLE_NO_CATCH) ENDIF() - IF(MALLOC_FILL) - ADD_DEFINITIONS(-DMALLOC_FILL) - ENDIF() ENDIF() IF(UNIX) diff --git a/library/Hooks-linux.cpp b/library/Hooks-linux.cpp index aeb719b84..3628aab63 100644 --- a/library/Hooks-linux.cpp +++ b/library/Hooks-linux.cpp @@ -141,24 +141,3 @@ DFhackCExport int SDL_Init(uint32_t flags) int ret = _SDL_Init(flags); return ret; } - -#ifdef MALLOC_FILL -DFhackCExport void * malloc(size_t size) -{ - static void* (*real_malloc)(size_t) = NULL; - if (!real_malloc) - real_malloc = (void * (*)( size_t )) dlsym(RTLD_NEXT, "malloc"); - // check if we got them - if(!real_malloc) - { - // bail, this would be a disaster otherwise - exit(1); - } - void * ret = real_malloc(size); - if(ret) - { - memset(ret, 0xCC, size); - } - return ret; -} -#endif