void Sys_BeginProfiling( void ) {
	if ( !sys_profile->integer ) {
		return;
	}
	ProfilerInit(collectDetailed, bestTimeBase, 16384, 64);
	sys_profiling = qtrue;
}
Exemple #2
0
void Step()
{
    DSPCore_CheckExceptions();

    g_dsp.step_counter++;

#if PROFILE
    g_dsp.err_pc = g_dsp.pc;

    ProfilerAddDelta(g_dsp.err_pc, 1);
    if (g_dsp.step_counter == 1)
    {
        ProfilerInit();
    }

    if ((g_dsp.step_counter & 0xFFFFF) == 0)
    {
        ProfilerDump(g_dsp.step_counter);
    }
#endif

    u16 opc = dsp_fetch_code();
    ExecuteInstruction(UDSPInstruction(opc));

    if (DSPAnalyzer::code_flags[g_dsp.pc - 1] & DSPAnalyzer::CODE_LOOP_END)
        HandleLoop();
}
Exemple #3
0
int
#if _WIN32_WCE
_cdecl
#endif
main()
{
    //  afxMemDF |= allocMemDF | checkAlwaysMemDF;

    // The M4STRING package sometimes keeps a spare empty string around.
    // By allocating it here, we avoid a few bogus memory leak reports.
    c4_String empty;

#if q4_MAC_LEAK_CHECK
    DebugNewForgetLeaks();
#endif

#if q4_MWCW_PROFILER
    if(!ProfilerInit(collectDetailed, bestTimeBase, 20, 5))
    {
#endif
        TestBasics1();
        TestBasics2();
        TestNotify();
        TestCustom1();
        TestCustom2();
        TestResize();
        TestStores1();
        TestStores2();
        TestStores3();
        TestStores4();
        TestStores5();
        TestDiffer();
        TestExtend();
        TestFormat();
        TestMapped();
        TestLimits();

#if q4_MWCW_PROFILER
        ProfilerDump("\pRegress.prof");
        ProfilerTerm();
    }
Exemple #4
0
bool wxApp::Initialize(int& argc, wxChar **argv)
{
    // Mac-specific

#if __WXDEBUG__
    InstallDebugAssertOutputHandler ( NewDebugAssertOutputHandlerUPP( wxMacAssertOutputHandler ) );
#endif
    UMAInitToolbox( 4, sm_isEmbedded ) ;
    SetEventMask( everyEvent ) ;
    UMAShowWatchCursor() ;

#ifndef __DARWIN__
#  if __option(profile)
    ProfilerInit( collectDetailed, bestTimeBase , 40000 , 50 ) ;
#  endif
#endif

#ifndef __DARWIN__
    // now avoid exceptions thrown for new (bad_alloc)
    // FIXME CS for some changes outside wxMac does not compile anymore
#if 0
    std::__throws_bad_alloc = 0 ;
#endif

#endif

    s_macCursorRgn = ::NewRgn() ;

    // Mac OS X passes a process serial number command line argument when
    // the application is launched from the Finder. This argument must be
    // removed from the command line arguments before being handled by the
    // application (otherwise applications would need to handle it)
    if ( argc > 1 )
    {
        static const wxChar *ARG_PSN = _T("-psn_");
        if ( wxStrncmp(argv[1], ARG_PSN, wxStrlen(ARG_PSN)) == 0 )
        {
            // remove this argument
            --argc;
            memmove(argv + 1, argv + 2, argc * sizeof(char *));
        }
    }

    if ( !wxAppBase::Initialize(argc, argv) )
        return false;

#if wxUSE_INTL
    wxFont::SetDefaultEncoding(wxLocale::GetSystemEncoding());
#endif

#if TARGET_API_MAC_OSX
    // these might be the startup dirs, set them to the 'usual' dir containing the app bundle
    wxString startupCwd = wxGetCwd() ;
    if ( startupCwd == wxT("/") || startupCwd.Right(15) == wxT("/Contents/MacOS") )
    {
        CFURLRef url = CFBundleCopyBundleURL(CFBundleGetMainBundle() ) ;
        CFURLRef urlParent = CFURLCreateCopyDeletingLastPathComponent( kCFAllocatorDefault , url ) ;
        CFRelease( url ) ;
        CFStringRef path = CFURLCopyFileSystemPath ( urlParent , kCFURLPOSIXPathStyle ) ;
        CFRelease( urlParent ) ;
        wxString cwd = wxMacCFStringHolder(path).AsString(wxLocale::GetSystemEncoding());       
        wxSetWorkingDirectory( cwd ) ;
    }
#endif

    wxMacCreateNotifierTable() ;

#ifdef __WXMAC_OSX__
    /* connect posted events to common-mode run loop so that wxPostEvent events
       are handled even while we're in the menu or on a scrollbar */
    CFRunLoopSourceContext event_posted_context = {0};
    event_posted_context.perform = macPostedEventCallback;
    m_macEventPosted = CFRunLoopSourceCreate(NULL,0,&event_posted_context);
    CFRunLoopAddSource(CFRunLoopGetCurrent(), m_macEventPosted, kCFRunLoopCommonModes);
#endif

    UMAShowArrowCursor() ;

    return true;
}