VirtualBox

Changeset 12537 in vbox for trunk/src/VBox/Main


Ignore:
Timestamp:
Sep 17, 2008 11:40:47 AM (16 years ago)
Author:
vboxsync
Message:

Use RTMemAllocZ/RTMemFree.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • 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();
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