Chromium Code Reviews| Index: components/tracing/core/string_interning.cc |
| diff --git a/components/tracing/core/string_interning.cc b/components/tracing/core/string_interning.cc |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..497bf74bcac1b6345ee12307dc25a4fdedf86c90 |
| --- /dev/null |
| +++ b/components/tracing/core/string_interning.cc |
| @@ -0,0 +1,19 @@ |
| +// Copyright 2016 The Chromium Authors. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +#include "components/tracing/core/string_interning.h" |
| + |
| +namespace tracing { |
| +namespace v2 { |
| + |
| +// TODO(primiano): there is a possibile optimization here: if we somehow |
| +// guarantee that kInternedStringBase is always laid out before any other string |
| +// in the binary, we can minimize the ptr distance and hence reduce the number |
| +// of bytes required to VarInt-encode it. Very likely this can be done using |
| +// __attribute__((section(X))) on Linux or __attribute__((section("__TEXT,X"))) |
| +// on OSX. |
|
kraynov
2016/09/08 16:10:01
Yep, maybe dynamic linker has some tricks as well.
Primiano Tucci (use gerrit)
2016/09/13 14:40:24
Acknowledged.
|
| +const char kInternedStringBase[] = "Chrome Tracing v2"; |
|
oystein (OOO til 10th of July)
2016/09/09 00:27:34
supernit: just "Tracing v2", there's other embedde
Primiano Tucci (use gerrit)
2016/09/13 14:40:24
Done.
|
| + |
| +} // namespace v2 |
| +} // namespace tracing |