VirtualBox

Changeset 84360 in vbox for trunk/src/VBox/Devices


Ignore:
Timestamp:
May 19, 2020 9:02:19 AM (5 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
138049
Message:

VUSB: Restored non-minimal initial control URB extra allocation (see bugref:9716).

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Devices/USB/VUSBUrb.cpp

    r84359 r84360  
    611611/** @todo reuse these? */
    612612    PVUSBCTRLEXTRA pExtra;
    613 #if 0
    614     const size_t cbMax = sizeof(pExtra->Urb.abData) + sizeof(VUSBSETUP);
    615 #else
    616     const size_t cbMax = sizeof(VUSBSETUP);
    617 #endif
     613    /* The initial allocation tries to balance wasted memory versus the need to re-allocate
     614     * the message data. Experience shows that an 8K initial allocation in practice never needs
     615     * to be expanded but almost certainly wastes 4K or more memory.
     616     */
     617    const size_t cbMax = _2K + sizeof(VUSBSETUP);
    618618    pExtra = (PVUSBCTRLEXTRA)RTMemAllocZ(RT_UOFFSETOF_DYN(VUSBCTRLEXTRA, Urb.abData[cbMax]));
    619619    if (pExtra)
Note: See TracChangeset for help on using the changeset viewer.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette