31 lines
973 B
C++
31 lines
973 B
C++
// Copyright 2019 The Marl Authors.
|
|
//
|
|
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
// you may not use this file except in compliance with the License.
|
|
// You may obtain a copy of the License at
|
|
//
|
|
// https://www.apache.org/licenses/LICENSE-2.0
|
|
//
|
|
// Unless required by applicable law or agreed to in writing, software
|
|
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
// See the License for the specific language governing permissions and
|
|
// limitations under the License.
|
|
|
|
#ifndef MARL_BUILD_WASM
|
|
|
|
#include <cstdint>
|
|
#include <cstddef>
|
|
#include <array>
|
|
#include <emscripten.h>
|
|
#include <emscripten/fiber.h>
|
|
|
|
struct marl_fiber_context {
|
|
// callee-saved data
|
|
static constexpr size_t asyncify_stack_size = 1024 * 1024;
|
|
emscripten_fiber_t context;
|
|
std::array</*std::byte*/ char, asyncify_stack_size> asyncify_stack;
|
|
};
|
|
|
|
#endif // MARL_BUILD_ASM
|