+namespace {
+
+/** Some location in the source code
+ *
+ * This information is used by SMPI_SHARED_MALLOC to allocate some shared memory for all simulated processes.
+ */
+class smpi_source_location {
+public:
+ smpi_source_location(const char* filename, int line)
+ : filename(xbt_strdup(filename)), filename_length(strlen(filename)), line(line) {}
+
+ /** Pointer to a static string containing the file name */
+ char* filename = nullptr;
+ int filename_length = 0;
+ int line = 0;
+
+ bool operator==(smpi_source_location const& that) const
+ {
+ return filename_length == that.filename_length
+ && line == that.line
+ && std::memcmp(filename, that.filename, filename_length) == 0;
+ }
+ bool operator!=(smpi_source_location const& that) const
+ {
+ return !(*this == that);
+ }
+};
+
+}
+
+namespace std {
+
+template<>
+class hash<smpi_source_location> {
+public:
+ typedef smpi_source_location argument_type;
+ typedef std::size_t result_type;
+ result_type operator()(smpi_source_location const& loc) const
+ {
+ return xbt_str_hash_ext(loc.filename, loc.filename_length)
+ ^ xbt_str_hash_ext((const char*) &loc.line, sizeof(loc.line));
+ }
+};
+
+}
+
+namespace {
+