Coverage Report

Created: 2017-07-31 13:21

/home/travis/build/MoarVM/MoarVM/src/core/callstack.h
Line
Count
Source (jump to first uncovered line)
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
#define MVM_CALLSTACK_REGION_SIZE 131072
20
21
/* Checks if a frame is allocated on a call stack or on the heap. If it is on
22
 * the call stack, then it will have zeroed flags (since heap-allocated frames
23
 * always have the "I'm a heap frame" bit set). */
24
0
MVM_STATIC_INLINE MVMuint32 MVM_FRAME_IS_ON_CALLSTACK(MVMThreadContext *tc, MVMFrame *frame) {
25
0
    return frame->header.flags == 0;
26
0
}
27
28
/* Functions for working with call stack regions. */
29
void MVM_callstack_region_init(MVMThreadContext *tc);
30
MVMCallStackRegion * MVM_callstack_region_next(MVMThreadContext *tc);
31
MVMCallStackRegion * MVM_callstack_region_prev(MVMThreadContext *tc);
32
void MVM_callstack_reset(MVMThreadContext *tc);
33
void MVM_callstack_region_destroy_all(MVMThreadContext *tc);