VirtualBox

Ignore:
Timestamp:
Apr 14, 2010 6:06:05 PM (15 years ago)
Author:
vboxsync
Message:

RTMemPageFree + all users: Added size parameter to RTMemPageFree so we can avoid tracking structures when using mmap/munmap.

Location:
trunk/src/VBox/Additions/common/VBoxService
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Additions/common/VBoxService/VBoxServiceBalloon.cpp

    r28048 r28317  
    6969    void *pv = RTMemPageAlloc(PAGE_SIZE);
    7070    g_fSysMadviseWorks = madvise(pv, PAGE_SIZE, MADV_DONTFORK) == 0;
    71     RTMemPageFree(pv);
     71    RTMemPageFree(pv, PAGE_SIZE);
    7272#endif
    7373}
     
    148148#else
    149149
    150     RTMemPageFree(pu8);
     150    RTMemPageFree(pu8, cb);
    151151
    152152#endif
  • trunk/src/VBox/Additions/common/VBoxService/VBoxServiceClipboard-os2.cpp

    r21218 r28317  
    423423         */
    424424        uint32_t cb = _4K;
    425         int rc = VERR_NO_MEMORY;
    426         void *pv = RTMemPageAllocZ(cb);
     425        uint32_t cbAllocated = cb;
     426        int      rc = VERR_NO_MEMORY;
     427        void    *pv = RTMemPageAllocZ(cbAllocated);
    427428        if (pv)
    428429        {
     
    431432            if (rc == VINF_BUFFER_OVERFLOW)
    432433            {
    433                 RTMemPageFree(pv);
    434                 cb = RT_ALIGN_32(cb, PAGE_SIZE);
    435                 pv = RTMemPageAllocZ(cb);
     434                RTMemPageFree(pv, cbAllocated);
     435                cbAllocated = cb = RT_ALIGN_32(cb, PAGE_SIZE);
     436                pv = RTMemPageAllocZ(cbAllocated);
    436437                rc = VbglR3ClipboardReadData(g_u32ClientId, fFormat, pv, cb, &cb);
    437438            }
    438439            if (RT_FAILURE(rc))
    439                 RTMemPageFree(pv);
     440                RTMemPageFree(pv, cbAllocated);
    440441        }
    441442        if (RT_SUCCESS(rc))
     
    458459                }
    459460            }
    460             RTMemPageFree(pv);
     461            RTMemPageFree(pv, cbAllocated);
    461462        }
    462463        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