From e95d6ed72b41e370140f3103de8b1a3b1eefbfec Mon Sep 17 00:00:00 2001 From: "ajwong@chromium.org" Date: Mon, 15 Oct 2012 20:36:05 +0000 Subject: Fix move.h's to use a concrete RValue carrier object rather than hacking a RValue&. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit For move semantics, we need to create a private "RValue" type that is used to create move constructors and move operators. Previously, we emulated Boost's idea of making the RValue type a subclass of the move-only type that doesn't add any new member fields. We then just reinterpret_cast "this" into a RValue& depending on the fact that RValue is just a type pun for the move-only type. This ends up being undefined behavior though (C++98 5.2.10.7). This change makes use a concrete RValue class that contains a pointer to the move-only type. With -O2 on clang version 3.2 (trunk 163674), this yields identical assembly code to the previous implementation. With -O0, we generate 2 more instructions to allocate and initialize the temporary RValue struct's object field when calling Pass(). This should be acceptable. The snowman says so ☃. BUG=155436 Review URL: https://chromiumcodereview.appspot.com/11078014 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@161945 0039d316-1c4b-4281-b951-d872f2087c98 --- media/mp4/mp4_stream_parser_unittest.cc | 1 - 1 file changed, 1 deletion(-) (limited to 'media/mp4') diff --git a/media/mp4/mp4_stream_parser_unittest.cc b/media/mp4/mp4_stream_parser_unittest.cc index 6c577ad..6d7221a 100644 --- a/media/mp4/mp4_stream_parser_unittest.cc +++ b/media/mp4/mp4_stream_parser_unittest.cc @@ -9,7 +9,6 @@ #include "base/bind_helpers.h" #include "base/logging.h" #include "base/memory/ref_counted.h" -#include "base/move.h" #include "base/time.h" #include "media/base/audio_decoder_config.h" #include "media/base/decoder_buffer.h" -- cgit v1.1