Get rid of MALLOC_FILL build option

develop
Petr Mrázek 2012-04-01 00:30:42 +02:00
parent 4bac6edd79
commit 209b261284
2 changed files with 0 additions and 25 deletions

@ -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) OPTION(BUILD_DOXYGEN "Create/install/package doxygen documentation for DFHack (For SDK)." OFF)
IF(UNIX) IF(UNIX)
OPTION(CONSOLE_NO_CATCH "Make the console not catch 'CTRL+C' events for easier debugging." OFF) 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() ENDIF()
include_directories (include) include_directories (include)
@ -216,9 +215,6 @@ IF(UNIX)
IF(CONSOLE_NO_CATCH) IF(CONSOLE_NO_CATCH)
ADD_DEFINITIONS(-DCONSOLE_NO_CATCH) ADD_DEFINITIONS(-DCONSOLE_NO_CATCH)
ENDIF() ENDIF()
IF(MALLOC_FILL)
ADD_DEFINITIONS(-DMALLOC_FILL)
ENDIF()
ENDIF() ENDIF()
IF(UNIX) IF(UNIX)

@ -141,24 +141,3 @@ DFhackCExport int SDL_Init(uint32_t flags)
int ret = _SDL_Init(flags); int ret = _SDL_Init(flags);
return ret; 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