Changeset 29546 in vbox for trunk/src/VBox/VMM
- Timestamp:
- May 17, 2010 2:05:42 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/VMMR0/GMMR0.cpp
r29510 r29546 1823 1823 { 1824 1824 case GMMACCOUNT_BASE: 1825 if (RT_UNLIKELY(pGVM->gmm.s.Allocated.cBasePages + pGVM->gmm.s.cBalloonedPages + cPages > pGVM->gmm.s.Reserved.cBasePages))1825 if (RT_UNLIKELY(pGVM->gmm.s.Allocated.cBasePages + pGVM->gmm.s.cBalloonedPages + pGVM->gmm.s.cSharedPages + cPages > pGVM->gmm.s.Reserved.cBasePages)) 1826 1826 { 1827 1827 Log(("gmmR0AllocatePages:Base: Reserved=%#llx Allocated+Ballooned+Requested=%#llx+%#llx+%#x!\n", … … 2711 2711 { 2712 2712 case GMMACCOUNT_BASE: 2713 if (RT_UNLIKELY(pGVM->gmm.s.Allocated.cBasePages < cPages))2713 if (RT_UNLIKELY(pGVM->gmm.s.Allocated.cBasePages + pGVM->gmm.s.cSharedPages < cPages)) 2714 2714 { 2715 2715 Log(("gmmR0FreePages: allocated=%#llx cPages=%#x!\n", pGVM->gmm.s.Allocated.cBasePages, cPages)); … … 2743 2743 int rc = VINF_SUCCESS; 2744 2744 uint32_t iPage; 2745 uint32_t cSharedPages = 0; 2745 2746 for (iPage = 0; iPage < cPages; iPage++) 2746 2747 { … … 2769 2770 Assert(pGVM->gmm.s.cSharedPages); 2770 2771 pGVM->gmm.s.cSharedPages--; 2772 cSharedPages++; 2771 2773 Assert(pPage->Shared.cRefs); 2772 2774 if (!--pPage->Shared.cRefs) … … 2789 2791 } 2790 2792 2793 Assert(iPage > cSharedPages); 2794 2791 2795 /* 2792 2796 * Update the account. … … 2794 2798 switch (enmAccount) 2795 2799 { 2796 case GMMACCOUNT_BASE: pGVM->gmm.s.Allocated.cBasePages -= iPage; break;2800 case GMMACCOUNT_BASE: pGVM->gmm.s.Allocated.cBasePages -= (iPage - cSharedPages); break; 2797 2801 case GMMACCOUNT_SHADOW: pGVM->gmm.s.Allocated.cShadowPages -= iPage; break; 2798 2802 case GMMACCOUNT_FIXED: pGVM->gmm.s.Allocated.cFixedPages -= iPage; break;
Note:
See TracChangeset
for help on using the changeset viewer.