-/* FIXME: check if we can delete this function */
-static XBT_INLINE e_smx_state_t SIMIX_action_map_state(e_surf_action_state_t state)
-{
- switch (state) {
- case SURF_ACTION_READY:
- return SIMIX_READY;
- case SURF_ACTION_RUNNING:
- return SIMIX_RUNNING;
- case SURF_ACTION_FAILED:
- return SIMIX_FAILED;
- case SURF_ACTION_DONE:
- return SIMIX_DONE;
- default:
- xbt_die("Unexpected SURF action state");
- }
-}
+/* We are using the bottom of the stack to save some information, like the
+ * valgrind_stack_id. Define smx_context_usable_stack_size to give the remaining
+ * size for the stack. */
+#ifdef HAVE_VALGRIND_VALGRIND_H
+# define smx_context_usable_stack_size \
+ (smx_context_stack_size - sizeof(unsigned int)) /* for valgrind_stack_id */
+#else
+# define smx_context_usable_stack_size smx_context_stack_size
+#endif