VirtualBox

Changeset 32 in vbox


Ignore:
Timestamp:
Jan 15, 2007 5:16:46 PM (18 years ago)
Author:
vboxsync
Message:

Added prealloc guest ram option.

File:
1 edited

Legend:

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

    r28 r32  
    194194    LogFlow(("MMR3InitPaging:\n"));
    195195    uint64_t    cbRam;
     196    bool        fPreAlloc = false;
     197
    196198    int rc = CFGMR3QueryU64(CFGMR3GetRoot(pVM), "RamSize", &cbRam);
    197199    if (rc == VERR_CFGM_VALUE_NOT_FOUND)
    198200        cbRam = 0;
     201
     202    rc = CFGMR3QueryBool(CFGMR3GetRoot(pVM), "PreAlloc", &fPreAlloc);
     203    if (rc == VERR_CFGM_VALUE_NOT_FOUND)
     204        fPreAlloc = false;
     205
    199206    if (VBOX_SUCCESS(rc) || rc == VERR_CFGM_VALUE_NOT_FOUND)
    200207    {
     
    215222            if (VBOX_SUCCESS(rc))
    216223                return rc;
     224
     225            /* Should we preallocate the entire guest RAM? */
     226            if (fPreAlloc)
     227            {
     228                RTGCPHYS GCPhys = PGM_DYNAMIC_CHUNK_SIZE;
     229
     230                for (;GCPhys < cbRam ; GCPhys+=PGM_DYNAMIC_CHUNK_SIZE)
     231                {
     232                    rc = PGM3PhysGrowRange(pVM, GCPhys);
     233                    if (VBOX_SUCCESS(rc))
     234                        return rc;
     235                }
     236            }
    217237        }
    218238#else
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