File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 2121#include "freelist.h"
2222#include "misc.h"
2323
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+
2432typedef struct {
2533 void * block ; /* address of the malloced block this chunk lives in */
2634 asize_t alloc ; /* in bytes, used for compaction */
2735 asize_t size ; /* in bytes */
2836 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 */
3139} heap_chunk_head ;
3240
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
3946
4047extern int caml_gc_phase ;
4148extern int caml_gc_subphase ;
Original file line number Diff line number Diff line change @@ -74,6 +74,15 @@ CAMLdeprecated_typedef(addr, char *);
7474 #define Noreturn
7575#endif
7676
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+
7786/* Export control (to mark primitives and to handle Windows DLL) */
7887
7988#ifndef CAMLDLLIMPORT
You can’t perform that action at this time.
0 commit comments