From 5548be597764f396bc3f96646e2e3201058ec984 Mon Sep 17 00:00:00 2001 From: Gabriel Corona Date: Thu, 17 Dec 2015 10:27:06 +0100 Subject: [PATCH] [xbt] Rewrite the doc about the motivation for simgrid::xbt::string --- include/xbt/string.hpp | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/include/xbt/string.hpp b/include/xbt/string.hpp index 30d6737a70..164d1a0fce 100644 --- a/include/xbt/string.hpp +++ b/include/xbt/string.hpp @@ -30,10 +30,21 @@ struct string_data { /** A std::string with well-known representation * - * This is a (incomplete) drop-in replacement for std::string. + * This is a (incomplete) drop-in replacement for `std::string`. + * It has a fixed POD representation (`simgrid::xbt::string_data`) + * which can be used to easily read the string content from another + * process. * - * This is used for cross-process access to strings - * (when the MC is enabled). + * The internal representation of a `std::string` is private. + * We could add some code to read this for a given implementation. + * However, even if we focus on GNU libstdc++ with Itanium ABI + * GNU libstdc++ currently has two different ABIs + * + * * the pre-C++11 is a pointer to a ref-counted + * string-representation (with support for COW); + * + * * the [C++11-conforming implementation](https://gcc.gnu.org/gcc-5/changes.html) + * does not use refcouting/COW but has a small string optimization. */ XBT_PUBLIC_CLASS string : private string_data { static const char NUL; -- 2.20.1