Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Useless complication.
authorArnaud Giersch <arnaud.giersch@univ-fcomte.fr>
Fri, 19 Feb 2021 08:31:07 +0000 (09:31 +0100)
committerArnaud Giersch <arnaud.giersch@univ-fcomte.fr>
Fri, 19 Feb 2021 09:19:02 +0000 (10:19 +0100)
src/kernel/context/Context.cpp

index 10056c7..9109f6b 100644 (file)
@@ -29,9 +29,7 @@ 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)
 {
-  static std::vector<unsigned char> sigsegv_stack;
-  if (sigsegv_stack.size() == 0)
-    sigsegv_stack.resize(SIGSTKSZ);
+  static std::vector<unsigned char> sigsegv_stack(SIGSTKSZ);
   stack_t stack;
   stack.ss_sp    = sigsegv_stack.data();
   stack.ss_size  = sigsegv_stack.size();