added makefile define FASTDEBUG to disable some debug-specific stuff, that is causing performance hits (for e.g. profiling) [Oliver Stöneberg]

This commit is contained in:
Oliver Stöneberg 2013-08-02 13:43:10 +00:00
parent 6cd622bc67
commit e533ab056f
4 changed files with 15 additions and 2 deletions

View File

@ -184,6 +184,9 @@ endif
# uncomment next line to build a debug version
# DEBUG = 1
# uncomment next line to disable some debug-related hotspots/slowdowns (e.g. for profiling)
# FASTDEBUG = 1
# uncomment next line to include the internal profiler
# PROFILER = 1
@ -443,6 +446,9 @@ ifneq ($(BUILD_JPEGLIB),1)
DEFS += -DUSE_SYSTEM_JPEGLIB
endif
ifdef FASTDEBUG
DEFS += -DMAME_DEBUG_FAST
endif
#-------------------------------------------------

View File

@ -357,7 +357,7 @@ void report_bad_device_cast(const device_t *dev, const std::type_info &src_type,
template<class _Dest, class _Source>
inline _Dest downcast(_Source *src)
{
#ifdef MAME_DEBUG
#if defined(MAME_DEBUG) && !defined(MAME_DEBUG_FAST)
try {
if (dynamic_cast<_Dest>(src) != src)
{
@ -378,7 +378,7 @@ inline _Dest downcast(_Source *src)
template<class _Dest, class _Source>
inline _Dest downcast(_Source &src)
{
#ifdef MAME_DEBUG
#if defined(MAME_DEBUG) && !defined(MAME_DEBUG_FAST)
try {
if (&dynamic_cast<_Dest>(src) != &src)
{

View File

@ -480,7 +480,9 @@ void device_scheduler::timeslice()
attoseconds_t delta = target.attoseconds - exec->m_localtime.attoseconds;
if (delta < 0 && target.seconds > exec->m_localtime.seconds)
delta += ATTOSECONDS_PER_SECOND;
#ifndef MAME_DEBUG_FAST
assert(delta == (target - exec->m_localtime).as_attoseconds());
#endif
// if we have enough for at least 1 cycle, do the math
if (delta >= exec->m_attoseconds_per_cycle)

View File

@ -144,7 +144,12 @@ endif
# enable basic run-time checks in non-optimized build
ifeq ($(OPTIMIZE),0)
ifndef FASTDEBUG
CCOMFLAGS += /RTC1
else
# disable the stack check since it has quite a speed impact
CCOMFLAGS += /RTCu
endif
endif
ifdef MSVC_ANALYSIS