X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/ad0cb80ebff7603232ec1621d9b6cfa1ea3471f6..cc766a2d2cf7348b2b5f7d78ba1bd9005949c8bd:/include/xbt/string.hpp diff --git a/include/xbt/string.hpp b/include/xbt/string.hpp index 30d6737a70..9840855a42 100644 --- a/include/xbt/string.hpp +++ b/include/xbt/string.hpp @@ -4,10 +4,12 @@ /* This program is free software; you can redistribute it and/or modify it * under the terms of the license (GNU LGPL) which comes with this package. */ -#ifndef SIMGRIC_XBT_STRING_HPP -#define SIMGRIC_XBT_STRING_HPP +#ifndef SIMGRID_XBT_STRING_HPP +#define SIMGRID_XBT_STRING_HPP -#ifdef HAVE_MC +#include + +#if HAVE_MC #include #include @@ -30,10 +32,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. + * + * 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 * - * This is used for cross-process access to strings - * (when the MC is enabled). + * * 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; @@ -285,4 +298,4 @@ typedef std::string string; #endif -#endif \ No newline at end of file +#endif