]> gitweb.factorcode.org Git - factor.git/blob - vm/errors.hpp
vm: Fail with out_of_memory() if mprotect returns ENOMEM.
[factor.git] / vm / errors.hpp
1 namespace factor {
2
3 // Runtime errors must be kept in sync with:
4 //   basis/debugger/debugger.factor
5 //   core/kernel/kernel.factor
6 enum vm_error_type {
7   ERROR_EXPIRED = 0,
8   ERROR_IO,
9   ERROR_NOT_IMPLEMENTED,
10   ERROR_TYPE,
11   ERROR_DIVIDE_BY_ZERO,
12   ERROR_SIGNAL,
13   ERROR_ARRAY_SIZE,
14   ERROR_OUT_OF_FIXNUM_RANGE,
15   ERROR_C_STRING,
16   ERROR_FFI,
17   ERROR_UNDEFINED_SYMBOL,
18   ERROR_DATASTACK_UNDERFLOW,
19   ERROR_DATASTACK_OVERFLOW,
20   ERROR_RETAINSTACK_UNDERFLOW,
21   ERROR_RETAINSTACK_OVERFLOW,
22   ERROR_CALLSTACK_UNDERFLOW,
23   ERROR_CALLSTACK_OVERFLOW,
24   ERROR_MEMORY,
25   ERROR_FP_TRAP,
26   ERROR_INTERRUPT,
27   ERROR_CALLBACK_SPACE_OVERFLOW
28 };
29
30 void fatal_error(const char* msg, cell tagged);
31 void critical_error(const char* msg, cell tagged);
32 void out_of_memory(const char* msg);
33 void memory_signal_handler_impl();
34 void fp_signal_handler_impl();
35 void synchronous_signal_handler_impl();
36
37 }