From 5196739a91ffe3433363024f8f0694c9a943da61 Mon Sep 17 00:00:00 2001 From: Arnaud Giersch Date: Tue, 6 Apr 2021 20:57:36 +0200 Subject: [PATCH] Stop using void* for xbt_mheap_t. --- src/include/xbt/xbt_modinter.h | 3 ++- src/mc/remote/RemoteProcess.cpp | 2 +- src/mc/remote/RemoteProcess.hpp | 4 ++-- src/mc/remote/mc_protocol.h | 3 ++- src/xbt/mmalloc/mm_module.c | 2 +- 5 files changed, 8 insertions(+), 6 deletions(-) diff --git a/src/include/xbt/xbt_modinter.h b/src/include/xbt/xbt_modinter.h index a9473cf603..5d718a55d6 100644 --- a/src/include/xbt/xbt_modinter.h +++ b/src/include/xbt/xbt_modinter.h @@ -8,6 +8,7 @@ #ifndef XBT_MODINTER_H #define XBT_MODINTER_H #include "xbt/misc.h" +#include "xbt/mmalloc.h" SG_BEGIN_DECL @@ -19,7 +20,7 @@ void xbt_log_postexit(void); void xbt_dict_preinit(void); void xbt_dict_postexit(void); -void* mmalloc_preinit(void); +xbt_mheap_t mmalloc_preinit(void); void mmalloc_postexit(void); extern int xbt_initialized; diff --git a/src/mc/remote/RemoteProcess.cpp b/src/mc/remote/RemoteProcess.cpp index eef3b180f5..491efb7985 100644 --- a/src/mc/remote/RemoteProcess.cpp +++ b/src/mc/remote/RemoteProcess.cpp @@ -217,7 +217,7 @@ int open_vm(pid_t pid, int flags) RemoteProcess::RemoteProcess(pid_t pid) : AddressSpace(this), pid_(pid), running_(true) {} -void RemoteProcess::init(void* mmalloc_default_mdp, void* maxpid, void* actors, void* dead_actors) +void RemoteProcess::init(xbt_mheap_t mmalloc_default_mdp, void* maxpid, void* actors, void* dead_actors) { this->heap_address = mmalloc_default_mdp; this->maxpid_addr_ = maxpid; diff --git a/src/mc/remote/RemoteProcess.hpp b/src/mc/remote/RemoteProcess.hpp index 19df38380d..75a9bbafe2 100644 --- a/src/mc/remote/RemoteProcess.hpp +++ b/src/mc/remote/RemoteProcess.hpp @@ -75,7 +75,7 @@ private: public: explicit RemoteProcess(pid_t pid); ~RemoteProcess() override; - void init(void* mmalloc_default_mdp, void* maxpid, void* actors, void* dead_actors); + void init(xbt_mheap_t mmalloc_default_mdp, void* maxpid, void* actors, void* dead_actors); RemoteProcess(RemoteProcess const&) = delete; RemoteProcess(RemoteProcess&&) = delete; @@ -246,7 +246,7 @@ private: public: /** Address of the heap structure in the MCed process. */ - void* heap_address; + xbt_mheap_t heap_address; /** Copy of the heap structure of the process * diff --git a/src/mc/remote/mc_protocol.h b/src/mc/remote/mc_protocol.h index 33d7cb1a6d..ccecad9188 100644 --- a/src/mc/remote/mc_protocol.h +++ b/src/mc/remote/mc_protocol.h @@ -20,6 +20,7 @@ #include "simgrid/forward.h" // aid_t #include #include +#include #include // ***** Messages @@ -59,7 +60,7 @@ struct s_mc_message_int_t { /* Client->Server */ struct s_mc_message_initial_addresses_t { simgrid::mc::MessageType type; - void* mmalloc_default_mdp; + xbt_mheap_t mmalloc_default_mdp; void* maxpid; void* actors; void* dead_actors; diff --git a/src/xbt/mmalloc/mm_module.c b/src/xbt/mmalloc/mm_module.c index 4a1f603284..c3f9b8c924 100644 --- a/src/xbt/mmalloc/mm_module.c +++ b/src/xbt/mmalloc/mm_module.c @@ -310,7 +310,7 @@ static void mmalloc_fork_child(void) } /* Initialize the default malloc descriptor. */ -void *mmalloc_preinit(void) +xbt_mheap_t mmalloc_preinit(void) { if (__mmalloc_default_mdp == NULL) { if(!xbt_pagesize) -- 2.20.1