VirtualBox

儲存庫 vbox 的更動 12537


忽略:
時間撮記:
2008-9-17 上午11:40:47 (16 年 以前)
作者:
vboxsync
訊息:

Use RTMemAllocZ/RTMemFree.

檔案:
修改 1 筆資料

圖例:

未更動
新增
刪除
  • trunk/src/VBox/Main/win/PerformanceWin.cpp

    r12536 r12537  
    4343#include <iprt/err.h>
    4444#include <iprt/mp.h>
     45#include <iprt/mem.h>
    4546
    4647#include <map>
     
    193194    uint64_t uTotalMhz   = 0;
    194195    RTCPUID  nProcessors = RTMpGetCount();
    195     PPROCESSOR_POWER_INFORMATION ppi = new PROCESSOR_POWER_INFORMATION[nProcessors];
     196    PPROCESSOR_POWER_INFORMATION ppi = (PPROCESSOR_POWER_INFORMATION)RTMemAllocZ(nProcessors * sizeof(PROCESSOR_POWER_INFORMATION));
    196197
    197198    if (!ppi)
     
    203204    {
    204205        Log(("CallNtPowerInformation() -> %x\n", ns));
    205         delete ppi;
     206        RTMemFree(ppi);
    206207        return VERR_INTERNAL_ERROR;
    207208    }
     
    212213    *mhz = (ULONG)(uTotalMhz / nProcessors);
    213214
    214     delete ppi;
     215    RTMemFree(ppi);
    215216    LogFlowThisFunc(("mhz=%u\n", *mhz));
    216217    LogFlowThisFuncLeave();
注意: 瀏覽 TracChangeset 來幫助您使用更動檢視器

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