Coverage Report

Created: 2018-07-03 15:31

/home/travis/build/MoarVM/MoarVM/src/core/regionalloc.h
Line
Count
Source
1
/* A block of bump-pointer allocated memory. For single-threaded use only. */
2
struct MVMRegionBlock {
3
    /* The memory buffer itself. */
4
    char *buffer;
5
6
    /* Current allocation position. */
7
    char *alloc;
8
9
    /* Allocation limit. */
10
    char *limit;
11
12
    /* Previous, now full, memory block. */
13
    MVMRegionBlock *prev;
14
};
15
16
struct MVMRegionAlloc {
17
    MVMRegionBlock *block;
18
};
19
20
/* The default allocation chunk size for memory blocks used to store spesh
21
 * graph nodes. Power of two is best; we start small also. */
22
21.1k
#define MVM_REGIONALLOC_FIRST_MEMBLOCK_SIZE 32768
23
377k
#define MVM_REGIONALLOC_MEMBLOCK_SIZE       8192
24
25
void * MVM_region_alloc(MVMThreadContext *tc, MVMRegionAlloc *alloc, size_t s);
26
void MVM_region_destroy(MVMThreadContext *tc, MVMRegionAlloc *alloc);