VirtualBox

Changeset 70114 in vbox


Ignore:
Timestamp:
Dec 13, 2017 3:52:42 PM (7 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
119663
Message:

(XP)COM: optimize safearray copying (partially, only dealing with the simple case where types are identical) and destruction, making the GUI have less overhead for some API calls

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/VBox/com/array.h

    r69107 r70114  
    239239
    240240    /** Initializes memory occupied by aElem. */
    241     static void Uninit(T &aElem) { aElem = 0; }
     241    static void Uninit(T &aElem) { RT_NOREF(aElem); }
    242242
    243243    /** Creates a deep copy of aFrom and stores it in aTo. */
  • trunk/src/VBox/Frontends/VirtualBox/src/globals/COMDefs.h

    r69500 r70114  
    271271    {
    272272        aVec.resize(static_cast<int>(aArr.size()));
    273         for (int i = 0; i < aVec.size(); ++i)
    274             aVec[i] = aArr[i];
     273        memcpy(&aVec[0], aArr.raw(), aArr.size() * sizeof(T));
    275274    }
    276275
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