Leonardo de Moura
4867dba175
fix(util/stackinfo): saving max stack size on OSX
...
see issue #628
2015-05-27 08:52:39 -07:00
Leonardo de Moura
516c0c73b9
refactor(*): remove dependency to thread_local C++11 keyword, the
...
current compilers have several bugs associated with it
We use the simpler __thread (gcc and clang) and
__declspec(thread) (visual studio).
2014-09-24 12:51:04 -07:00
Leonardo de Moura
fb5c7c8e92
fix(util/stackinfo): on OSX Boost does not seem to be based on pthread library
...
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2014-06-07 20:47:46 -07:00
Leonardo de Moura
15f0899efb
refactor(*): replace LEAN_THREAD_LOCAL with MK_THREAD_LOCAL_GET, the new macro uses the Boost thread_local_ptr instead of 'thread_local' directive
...
Motivation: clang++ on OSX does not support 'thread_local'.
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2014-06-07 10:18:36 -07:00
Leonardo de Moura
b81d536946
fix(util/stackinfo): make sure check_stack can be invoked before 'main' (i.e., during initialization)
...
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2014-06-03 14:57:32 -07:00
Leonardo de Moura
0cd8e3e76b
feat(split-stack): add support for split-stacks (no more stackoverflows)
...
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-12-09 22:30:54 -08:00
Leonardo de Moura
fd2a04e9ac
fix(util/stackinfo): bug on Fedora
...
Signed-off-by: Leonardo de Moura <leonardo@nod1-2008.corp.crtest.com>
2013-12-09 18:44:14 -08:00
Leonardo de Moura
8f2fe273ea
refactor(*): isolate std::thread dependency
...
This commit allows us to build Lean without the pthread dependency.
It is also useful if we want to implement multi-threading on top of Boost.
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-12-09 15:20:26 -08:00
Leonardo de Moura
e2999d3ff6
feat(*): add component name to check_stack and check_system
...
I also reduced the stack size to 8 Mb in the tests at tests/lean and tests/lean/slow. The idea is to simulate stackoverflow conditions.
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-12-07 15:11:55 -08:00
Leonardo de Moura
d949dfd46d
fix(util/stackinfo): compilation warning on cygwin/mingw
...
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-12-04 11:32:39 -08:00
Leonardo de Moura
def186a9cd
fix(util/stackinfo): try to fix incorrect main thread stack size on OSX
...
This fix tries to fix two failures on our unit tests.
tests/kernel/normalizer
tests/kernel/type_checker
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-12-04 08:56:46 -08:00
Leonardo de Moura
fd9781d58d
fix(util/stackinfo): compilation warning on mingw and cygwin
...
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-12-04 08:26:50 -08:00
Leonardo de Moura
39b99683a8
fix(util/stackinfo): handle error codes in the Linux version
...
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-12-02 07:56:53 -08:00
Soonho Kong
31b26f53ad
fix(util/stackinfo): fix typo
2013-12-02 00:03:57 -05:00
Soonho Kong
7776f4b24b
fix(util/stackinfo): fix preprocessor directive
2013-12-01 23:44:58 -05:00
Soonho Kong
4de3b772fd
feat(util/stackinfo): implement get_stack_size (Mac OSX version)
2013-12-01 22:24:12 -05:00
Leonardo de Moura
75f8d56eb1
fix(util/stackinfo): memory leak at get_stack_size
...
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-12-01 19:17:28 -08:00
Leonardo de Moura
74dfdd02de
feat(util): add primitives for checking the amount of available stack space
...
Recursive functions that may go very deep should invoke the function check_stack. It throws an exception if the amount of stack space is limited.
The function check_system() is syntax sugar for
check_interrupted();
check_stack();
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-12-01 17:19:27 -08:00