/home/travis/build/MoarVM/MoarVM/src/core/callstack.h
Line | Count | Source |
1 | | /* A region of the call stack, used for call frames that have not escaped to |
2 | | * the heap. */ |
3 | | struct MVMCallStackRegion { |
4 | | /* Next call stack region, which we start allocating in if this one is |
5 | | * full. NULL if none has been allocated yet. */ |
6 | | MVMCallStackRegion *next; |
7 | | |
8 | | /* Previous call stack region, if any. */ |
9 | | MVMCallStackRegion *prev; |
10 | | |
11 | | /* The place we'll allocate the next frame. */ |
12 | | char *alloc; |
13 | | |
14 | | /* The end of the allocatable region. */ |
15 | | char *alloc_limit; |
16 | | }; |
17 | | |
18 | | /* The default size of a call stack region. */ |
19 | 634 | #define MVM_CALLSTACK_REGION_SIZE 131072 |
20 | | |
21 | | /* Functions for working with call stack regions. */ |
22 | | void MVM_callstack_region_init(MVMThreadContext *tc); |
23 | | MVMCallStackRegion * MVM_callstack_region_next(MVMThreadContext *tc); |
24 | | MVMCallStackRegion * MVM_callstack_region_prev(MVMThreadContext *tc); |
25 | | void MVM_callstack_reset(MVMThreadContext *tc); |
26 | | void MVM_callstack_region_destroy_all(MVMThreadContext *tc); |