QuantumLibrary
quantum_stack_traits.h
1 /*
2 ** Copyright 2018 Bloomberg Finance L.P.
3 **
4 ** Licensed under the Apache License, Version 2.0 (the "License");
5 ** you may not use this file except in compliance with the License.
6 ** You may obtain a copy of the License at
7 **
8 ** http://www.apache.org/licenses/LICENSE-2.0
9 **
10 ** Unless required by applicable law or agreed to in writing, software
11 ** distributed under the License is distributed on an "AS IS" BASIS,
12 ** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 ** See the License for the specific language governing permissions and
14 ** limitations under the License.
15 */
16 #ifndef BLOOMBERG_QUANTUM_STACK_TRAITS_H
17 #define BLOOMBERG_QUANTUM_STACK_TRAITS_H
18 
19 #include <boost/context/stack_traits.hpp>
20 
21 namespace Bloomberg {
22 namespace quantum {
23 
24 //==============================================================================================
25 // struct StackTraits
26 //==============================================================================================
31 struct StackTraits {
34  static bool& isUnbounded();
35 
38  static size_t& pageSize();
39 
43  static size_t& defaultSize();
44 
48  static size_t& minimumSize();
49 
53  static size_t& maximumSize();
54 };
55 
56 }}
57 
58 #include <quantum/impl/quantum_stack_traits_impl.h>
59 
60 #endif //BLOOMBERG_QUANTUM_STACK_TRAITS_H
Definition: quantum_buffer_impl.h:22
static size_t & maximumSize()
Get/set the maximum stack size.
Definition: quantum_stack_traits_impl.h:54
static size_t & pageSize()
Get/set the page size.
Definition: quantum_stack_traits_impl.h:33
static size_t & minimumSize()
Get/set the minimum stack size as defined by the environment.
Definition: quantum_stack_traits_impl.h:47
static bool & isUnbounded()
Get/set if the environment defines a limit for the stack size.
Definition: quantum_stack_traits_impl.h:26
static size_t & defaultSize()
Get/set the default stack size, which may be platform specific.
Definition: quantum_stack_traits_impl.h:40
Allows application-wide overrides for the coroutine stack traits which are used internally by boost::...
Definition: quantum_stack_traits.h:31