Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Kill a parameter that was always nullptr
authorMartin Quinson <martin.quinson@ens-rennes.fr>
Sun, 15 Jan 2023 23:25:58 +0000 (00:25 +0100)
committerMartin Quinson <martin.quinson@ens-rennes.fr>
Mon, 16 Jan 2023 07:46:08 +0000 (08:46 +0100)
src/kernel/EngineImpl.cpp
src/kernel/context/Context.cpp
src/kernel/context/Context.hpp
src/kernel/context/ContextThread.cpp

index 0d1c7fe..3e47039 100644 (file)
@@ -120,7 +120,7 @@ static void segvhandler(int signum, siginfo_t* siginfo, void* /*context*/)
  */
 static void install_segvhandler()
 {
-  if (simgrid::kernel::context::Context::install_sigsegv_stack(nullptr, true) == -1) {
+  if (simgrid::kernel::context::Context::install_sigsegv_stack(true) == -1) {
     XBT_WARN("Failed to register alternate signal stack: %s", strerror(errno));
     return;
   }
index 1b9e459..040d783 100644 (file)
@@ -79,14 +79,14 @@ ContextFactory::~ContextFactory() = default;
 thread_local Context* Context::current_context_ = nullptr;
 
 /* Install or disable alternate signal stack, for SIGSEGV handler. */
-int Context::install_sigsegv_stack(stack_t* old_stack, bool enable)
+int Context::install_sigsegv_stack(bool enable)
 {
   static std::vector<unsigned char> sigsegv_stack(SIGSTKSZ);
   stack_t stack;
   stack.ss_sp    = sigsegv_stack.data();
   stack.ss_size  = sigsegv_stack.size();
   stack.ss_flags = enable ? 0 : SS_DISABLE;
-  return sigaltstack(&stack, old_stack);
+  return sigaltstack(&stack, nullptr);
 }
 
 Context* Context::self()
index 9bcc41e..25d8113 100644 (file)
@@ -53,7 +53,7 @@ class XBT_PUBLIC Context {
   void declare_context(std::size_t size);
 
 public:
-  static int install_sigsegv_stack(stack_t* old_stack, bool enable);
+  static int install_sigsegv_stack(bool enable);
 
   Context(std::function<void()>&& code, actor::ActorImpl* actor, bool maestro);
   Context(const Context&) = delete;
index 7ed881a..c6901c9 100644 (file)
@@ -84,7 +84,7 @@ void ThreadContext::wrapper(ThreadContext* context)
 {
   Context::set_current(context);
 
-  install_sigsegv_stack(nullptr, true);
+  install_sigsegv_stack(true);
   // Tell the caller (normally the maestro) we are starting, and wait for its green light
   context->end_.release();
   context->start();
@@ -103,7 +103,7 @@ void ThreadContext::wrapper(ThreadContext* context)
   // Signal to the caller (normally the maestro) that we have finished:
   context->yield();
 
-  install_sigsegv_stack(nullptr, false);
+  install_sigsegv_stack(false);
   XBT_DEBUG("Terminating");
   Context::set_current(nullptr);
 }