VirtualBox

Changeset 24986 in vbox for trunk/src/VBox/Runtime/common


Ignore:
Timestamp:
Nov 26, 2009 10:59:03 AM (15 years ago)
Author:
vboxsync
Message:

IPRT/log.cpp: Don't use RTMemExecAlloc if RT_WITHOUT_EXEC_ALLOC and LOG_USE_C99 are defined.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Runtime/common/log/log.cpp

    r23215 r24986  
    295295         * Emit wrapper code.
    296296         */
     297#if defined(LOG_USE_C99) && defined(RT_WITHOUT_EXEC_ALLOC)
     298        pu8Code = (uint8_t *)RTMemAlloc(64);
     299#else
    297300        pu8Code = (uint8_t *)RTMemExecAlloc(64);
     301#endif
    298302        if (pu8Code)
    299303        {
    300304            pLogger->pfnLogger = *(PFNRTLOGGER*)&pu8Code;
    301 #ifdef RT_ARCH_AMD64
     305#if defined(RT_ARCH_AMD64) || defined(RT_LOG_
    302306            /* this wrapper will not be used on AMD64, we will be requiring C99 compilers there. */
    303307            *pu8Code++ = 0xcc;
     
    425429            RTFileClose(pLogger->File);
    426430#endif
     431#if defined(LOG_USE_C99) && defined(RT_WITHOUT_EXEC_ALLOC)
     432            RTMemFree(*(void **)&pLogger->pfnLogger);
     433#else
    427434            RTMemExecFree(*(void **)&pLogger->pfnLogger);
     435#endif
    428436        }
    429437        else
     
    581589    if (pLogger->pfnLogger)
    582590    {
     591#if defined(LOG_USE_C99) && defined(RT_WITHOUT_EXEC_ALLOC)
     592        RTMemFree(*(void **)&pLogger->pfnLogger);
     593#else
    583594        RTMemExecFree(*(void **)&pLogger->pfnLogger);
     595#endif
    584596        pLogger->pfnLogger = NULL;
    585597    }
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette