File tree 4 files changed +269
-90
lines changed
4 files changed +269
-90
lines changed Original file line number Diff line number Diff line change 21
21
#include "freelist.h"
22
22
#include "misc.h"
23
23
24
+ /* An interval of a single object to be scanned.
25
+ The end pointer must always be one-past-the-end of a heap block,
26
+ but the start pointer is not necessarily the start of the block */
27
+ typedef struct {
28
+ value * start ;
29
+ value * end ;
30
+ } mark_entry ;
31
+
24
32
typedef struct {
25
33
void * block ; /* address of the malloced block this chunk lives in */
26
34
asize_t alloc ; /* in bytes, used for compaction */
27
35
asize_t size ; /* in bytes */
28
36
char * next ;
29
- value * redarken_start ; /* first block in chunk to redarken */
30
- value * redarken_end ; /* last block in chunk that needs redarkening */
37
+ mark_entry redarken_first ; /* first block in chunk to redarken */
38
+ value * redarken_end ; /* one-past-end of last block for redarkening */
31
39
} heap_chunk_head ;
32
40
33
- #define Chunk_size (c ) (((heap_chunk_head *) (c)) [-1]).size
34
- #define Chunk_alloc (c ) (((heap_chunk_head *) (c)) [-1]).alloc
35
- #define Chunk_next (c ) (((heap_chunk_head *) (c)) [-1]).next
36
- #define Chunk_block (c ) (((heap_chunk_head *) (c)) [-1]).block
37
- #define Chunk_redarken_start (c ) (((heap_chunk_head *) (c)) [-1]).redarken_start
38
- #define Chunk_redarken_end (c ) (((heap_chunk_head *) (c)) [-1]).redarken_end
41
+ #define Chunk_head (c ) (((heap_chunk_head *) (c)) - 1)
42
+ #define Chunk_size (c ) Chunk_head(c)->size
43
+ #define Chunk_alloc (c ) Chunk_head(c)->alloc
44
+ #define Chunk_next (c ) Chunk_head(c)->next
45
+ #define Chunk_block (c ) Chunk_head(c)->block
39
46
40
47
extern int caml_gc_phase ;
41
48
extern int caml_gc_subphase ;
Original file line number Diff line number Diff line change @@ -74,6 +74,15 @@ CAMLdeprecated_typedef(addr, char *);
74
74
#define Noreturn
75
75
#endif
76
76
77
+ /* Manually preventing inlining */
78
+ #if defined(__GNUC__)
79
+ #define Caml_noinline __attribute__ ((noinline))
80
+ #elif defined(_MSC_VER)
81
+ #define Caml_noinline __declspec (noinline)
82
+ #else
83
+ #define Caml_noinline
84
+ #endif
85
+
77
86
/* Export control (to mark primitives and to handle Windows DLL) */
78
87
79
88
#ifndef CAMLDLLIMPORT
You can’t perform that action at this time.
0 commit comments