dolphin/Source/Core
Lioncash f7bc75ae6d Boot: Make BootExecutableReader's constructor take a std::vector by value
This allows avoiding two copies of the executable data being created in
the following scenario (using pseudocode):

some_function()
{
  std::vector<u8> data = ...;
  DolReader reader{data};

  ...
}

In this scenario, if we only use the data for passing it to DolReader,
then we have to perform a copy, as the constructor takes the std::vector
as a constant reference -- you cannot move from a constant reference,
and so we copy data into the DolReader, and perform another copy in the
constructor itself when assigning the data to the m_bytes member
variable. However, we can do better.

Now, the following is allowable as well:

some_function()
{
  std::vector<u8> data = ...;
  DolReader reader{std::move(data)};

  ...
}

and now we perform no copy at any point in the reader's construction, as
we just std::move the data all the way through to m_bytes.

In the case where we *do* want to keep the executable data around after
constructing the reader, then we can just pass the vector without
std::move-ing it, and we only perform a copy once (as we'll std::move
said copy into m_bytes). Therefore, we get a more flexible interface
resource-wise out of it.
2018-05-12 17:40:34 -04:00
..
AudioCommon
Common Merge pull request #6825 from leoetlino/onion-types 2018-05-12 21:59:43 +02:00
Core Boot: Make BootExecutableReader's constructor take a std::vector by value 2018-05-12 17:40:34 -04:00
DiscIO NandPaths: Return paths that are relative to Wii NAND 2018-05-04 19:52:17 +02:00
DolphinNoGUI UICommon: Avoid including Xrandr.h 2018-04-14 17:14:38 +02:00
DolphinQt2 Merge pull request #6825 from leoetlino/onion-types 2018-05-12 21:59:43 +02:00
DolphinWX Config: Add support for enums 2018-05-12 18:10:26 +02:00
InputCommon THis fixes issue #08 and #16, the rumble test and slider 2018-04-19 17:48:55 -04:00
UICommon Qt: Allow custom stylesheets 2018-05-08 15:07:50 +02:00
Updater Updater: Show error when trying to launch directly 2018-05-05 23:32:08 +02:00
VideoBackends Merge pull request #6825 from leoetlino/onion-types 2018-05-12 21:59:43 +02:00
VideoCommon Config: Add support for enums 2018-05-12 18:10:26 +02:00
CMakeLists.txt