-/* Copyright (c) 2009-2020. The SimGrid Team. All rights reserved. */
+/* Copyright (c) 2009-2021. The SimGrid Team. All rights reserved. */
/* This program is free software; you can redistribute it and/or modify it
* under the terms of the license (GNU LGPL) which comes with this package. */
// Raw context routines
-typedef void (*rawctx_entry_point_t)(simgrid::kernel::context::SwappedContext*);
+using rawctx_entry_point_t = void (*)(simgrid::kernel::context::SwappedContext*);
-typedef void* raw_stack_t;
+using raw_stack_t = void*;
extern "C" raw_stack_t raw_makecontext(void* malloced_stack, int stack_size, rawctx_entry_point_t entry_point,
simgrid::kernel::context::SwappedContext* arg);
extern "C" void raw_swapcontext(raw_stack_t* old, raw_stack_t new_context);
RawContext::RawContext(std::function<void()>&& code, actor::ActorImpl* actor, SwappedContextFactory* factory)
: SwappedContext(std::move(code), actor, factory)
{
- XBT_VERB("Creating a context of stack %uMb", smx_context_stack_size / 1024 / 1024);
+ XBT_VERB("Creating a context of stack %uMb", actor->get_stacksize() / 1024 / 1024);
if (has_code()) {
- this->stack_top_ = raw_makecontext(get_stack(), smx_context_stack_size, smx_ctx_wrapper, this);
+ this->stack_top_ = raw_makecontext(get_stack(), actor->get_stacksize(), smx_ctx_wrapper, this);
} else {
if (MC_is_active())
MC_ignore_heap(&stack_top_, sizeof(stack_top_));