X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/d20f024dba9ff1e9c8822237caaf963b9e913889..fb7ae778e5908c72ae16db143a1eb98ec3930db3:/src/msg/msg_io.cpp diff --git a/src/msg/msg_io.cpp b/src/msg/msg_io.cpp index 592312a0e1..fd4ad9a032 100644 --- a/src/msg/msg_io.cpp +++ b/src/msg/msg_io.cpp @@ -478,10 +478,11 @@ void *MSG_storage_get_data(msg_storage_t storage) xbt_dict_t MSG_storage_get_content(msg_storage_t storage) { std::map* content = storage->getContent(); - xbt_dict_t content_as_dict = xbt_dict_new_homogeneous(xbt_free_f); + // Note: ::operator delete is ok here (no destructor called) since the dict elements are of POD type sg_size_t. + xbt_dict_t content_as_dict = xbt_dict_new_homogeneous(::operator delete); for (auto const& entry : *content) { - sg_size_t* psize = static_cast(malloc(sizeof(sg_size_t))); + sg_size_t* psize = new sg_size_t; *psize = entry.second; xbt_dict_set(content_as_dict, entry.first.c_str(), psize, nullptr); }