mruby/c VM Source Code release 3.4
Loading...
Searching...
No Matches
vm_config.h
Go to the documentation of this file.
1
12
13#ifndef MRBC_SRC_VM_CONFIG_H_
14#define MRBC_SRC_VM_CONFIG_H_
15
16// maximum number of VMs
17#if !defined(MAX_VM_COUNT)
18#define MAX_VM_COUNT 5
19#endif
20
21// maximum size of registers
22#if !defined(MAX_REGS_SIZE)
23#define MAX_REGS_SIZE 110
24#endif
25
26// maximum number of symbols
27#if !defined(MAX_SYMBOLS_COUNT)
28#define MAX_SYMBOLS_COUNT 255
29#endif
30
31
32// memory management
33// MRBC_ALLOC_16BIT or MRBC_ALLOC_24BIT
34#define MRBC_ALLOC_24BIT
35
36
37/* USE Float. Support Float class.
38 0: NOT USE
39 1: USE float
40 2: USE double
41*/
42#if !defined(MRBC_USE_FLOAT)
43#define MRBC_USE_FLOAT 2
44#endif
45
46// Use math. Support Math class.
47#if !defined(MRBC_USE_MATH)
48#define MRBC_USE_MATH 0
49#endif
50/* (NOTE)
51 maybe you need
52 $ export LDFLAGS=-lm
53 $ make
54
55 on ubuntu
56 $ export LDFLAGS="-Wl,--no-as-needed -lm"
57 $ make
58*/
59
60// USE String. Support String class.
61#if !defined(MRBC_USE_STRING)
62#define MRBC_USE_STRING 1
63#endif
64
65
66/* Hardware dependent flags
67
68 Use the MRBC_BIG_ENDIAN, MRBC_LITTLE_ENDIAN and MRBC_REQUIRE_*BIT_ALIGNMENT
69 macros.
70 for conversion functions from binary (byte array) to each data type.
71
72 (each cases)
73 Little endian, no alignment.
74 MRBC_LITTLE_ENDIAN && !MRBC_REQUIRE_32BIT_ALIGNMENT
75 (e.g.) ARM Cortex-M4, Intel x86
76
77 Big endian, no alignment.
78 MRBC_BIG_ENDIAN && !MRBC_REQUIRE_32BIT_ALIGNMENT
79 (e.g.) IBM PPC405
80
81 Little endian, 32bit alignment required.
82 MRBC_LITTLE_ENDIAN && MRBC_REQUIRE_32BIT_ALIGNMENT
83 (e.g.) ARM Cortex-M0
84
85 Big endian, 32bit alignment required.
86 MRBC_BIG_ENDIAN) && MRBC_REQUIRE_32BIT_ALIGNMENT
87 (e.g.) OpenRISC
88*/
89
90/* Endian
91 Define either MRBC_BIG_ENDIAN or MRBC_LITTLE_ENDIAN.
92*/
93#if !defined(MRBC_BIG_ENDIAN) && !defined(MRBC_LITTLE_ENDIAN)
94# define MRBC_LITTLE_ENDIAN
95#endif
96
97/* Word alignment
98 If 32bit and/or 64bit alignment is required, enable the following line.
99*/
100// #define MRBC_REQUIRE_32BIT_ALIGNMENT
101#define MRBC_REQUIRE_64BIT_ALIGNMENT
102
103
104/* Others */
105
106// Compile with debug code.
107#if !defined(NDEBUG)
108#define MRBC_DEBUG
109#endif
110
111// #define MRBC_NO_TIMER
112
113// Console new-line mode.
114// If you need to convert LF to CRLF in console output, enable the following:
115// #define MRBC_CONVERT_CRLF
116
117// If you need 64bit integer.
118// #define MRBC_INT64
119
120// If you get exception with message "Not support op_ext..." when runtime.
121// #define MRBC_SUPPORT_OP_EXT
122
123// If you use LIBC malloc instead of mruby/c malloc
124// #define MRBC_ALLOC_LIBC
125
126// Nesting level for exception printing (default 8)
127// #define MRBC_EXCEPTION_CALL_NEST_LEVEL 8
128
129// Examples of override actions when some fatal errors.
130// #define MRBC_OUT_OF_MEMORY() mrbc_alloc_print_memory_pool(); hal_abort(0)
131// #define MRBC_ABORT_BY_EXCEPTION(vm) mrbc_p( &vm->exception ); hal_abort(0)
132
133#endif // MRBC_SRC_VM_CONFIG_H_