YACLib
C++ library for concurrent tasks execution
Loading...
Searching...
No Matches
default_allocator.hpp
Go to the documentation of this file.
1#pragma once
2
4#include <yaclib/log.hpp>
5
6#include <cstdint>
7#include <vector>
8
9namespace yaclib::detail::fiber {
10
11/**
12 * Allocator used by default
13 */
15 public:
16 [[nodiscard]] Allocation Allocate() final;
17
18 void Release(Allocation allocation) final;
19
20 void SetMinStackSize(std::size_t pages) noexcept final;
21
22 std::size_t GetMinStackSize() noexcept final;
23
24 static void SetCacheSize(std::uint32_t size) noexcept;
25
26 private:
27 std::vector<Allocation> _pool;
28 std::size_t _stack_size_pages{8};
29};
30
31} // namespace yaclib::detail::fiber
static void SetCacheSize(std::uint32_t size) noexcept
std::size_t GetMinStackSize() noexcept final
void Release(Allocation allocation) final
void SetMinStackSize(std::size_t pages) noexcept final
Passed to coroutine/fiber constructor, specifies the way in which memory for Stack is Allocated and R...
Contract< V, E > MakeContract()
Creates related future and promise.
Definition contract.hpp:25