VirtualBox

Changeset 31529 in vbox for trunk


Ignore:
Timestamp:
Aug 10, 2010 12:13:57 PM (14 years ago)
Author:
vboxsync
Message:

pSharedModules -> g_apSharedModules. (r64559 looked like RT_ELEMENTS was applied to a pointer.)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/VMM/PGMSharedPage.cpp

    r31478 r31529  
    3636#include "PGMInline.h"
    3737
     38/*******************************************************************************
     39*   Global Variables                                                           *
     40*******************************************************************************/
    3841#if defined(VBOX_STRICT) && HC_ARCH_BITS == 64
    39 /* Keep a copy of all registered shared modules for the .pgmcheckduppages debugger command. */
    40 static PGMMREGISTERSHAREDMODULEREQ pSharedModules[512] = {0};
    41 static unsigned cSharedModules = 0;
     42/** Keep a copy of all registered shared modules for the .pgmcheckduppages debugger command. */
     43static PGMMREGISTERSHAREDMODULEREQ g_apSharedModules[512] = {0};
     44static unsigned g_cSharedModules = 0;
    4245#endif
    4346
     
    8992        PGMMREGISTERSHAREDMODULEREQ *ppSharedModule = NULL;
    9093
    91         if (cSharedModules < RT_ELEMENTS(pSharedModules))
     94        if (g_cSharedModules < RT_ELEMENTS(g_apSharedModules))
    9295        {
    93             for (unsigned i = 0; i < RT_ELEMENTS(pSharedModules); i++)
     96            for (unsigned i = 0; i < RT_ELEMENTS(g_apSharedModules); i++)
    9497            {
    95                 if (pSharedModules[i] == NULL)
     98                if (g_apSharedModules[i] == NULL)
    9699                {
    97                     ppSharedModule = &pSharedModules[i];
     100                    ppSharedModule = &g_apSharedModules[i];
    98101                    break;
    99102                }
     
    105108                *ppSharedModule = (PGMMREGISTERSHAREDMODULEREQ)RTMemAllocZ(RT_OFFSETOF(GMMREGISTERSHAREDMODULEREQ, aRegions[cRegions]));
    106109                memcpy(*ppSharedModule, pReq, RT_OFFSETOF(GMMREGISTERSHAREDMODULEREQ, aRegions[cRegions]));
    107                 cSharedModules++;
     110                g_cSharedModules++;
    108111            }
    109112        }
     
    155158
    156159# if defined(VBOX_STRICT) && HC_ARCH_BITS == 64
    157     for (unsigned i = 0; i < cSharedModules; i++)
    158     {
    159         if (    pSharedModules[i]
    160             &&  !strcmp(pSharedModules[i]->szName, pszModuleName)
    161             &&  !strcmp(pSharedModules[i]->szVersion, pszVersion))
     160    for (unsigned i = 0; i < g_cSharedModules; i++)
     161    {
     162        if (    g_apSharedModules[i]
     163            &&  !strcmp(g_apSharedModules[i]->szName, pszModuleName)
     164            &&  !strcmp(g_apSharedModules[i]->szVersion, pszVersion))
    162165        {
    163             RTMemFree(pSharedModules[i]);
    164             pSharedModules[i] = NULL;
    165             cSharedModules--;
     166            RTMemFree(g_apSharedModules[i]);
     167            g_apSharedModules[i] = NULL;
     168            g_cSharedModules--;
    166169            break;
    167170        }
     
    399402    do
    400403    {
    401         if (pSharedModules[i])
     404        if (g_apSharedModules[i])
    402405        {
    403             pCmdHlp->pfnPrintf(pCmdHlp, NULL, "Shared module %s (%s):\n", pSharedModules[i]->szName, pSharedModules[i]->szVersion);
    404             for (unsigned j = 0; j < pSharedModules[i]->cRegions; j++)
    405                 pCmdHlp->pfnPrintf(pCmdHlp, NULL, "--- Region %d: base %RGv size %x\n", j, pSharedModules[i]->aRegions[j].GCRegionAddr, pSharedModules[i]->aRegions[j].cbRegion);
     406            pCmdHlp->pfnPrintf(pCmdHlp, NULL, "Shared module %s (%s):\n", g_apSharedModules[i]->szName, g_apSharedModules[i]->szVersion);
     407            for (unsigned j = 0; j < g_apSharedModules[i]->cRegions; j++)
     408                pCmdHlp->pfnPrintf(pCmdHlp, NULL, "--- Region %d: base %RGv size %x\n", j, g_apSharedModules[i]->aRegions[j].GCRegionAddr, g_apSharedModules[i]->aRegions[j].cbRegion);
    406409        }
    407410        i++;
    408411    }
    409     while (i < RT_ELEMENTS(pSharedModules));
     412    while (i < RT_ELEMENTS(g_apSharedModules));
    410413    pgmUnlock(pVM);
    411414
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