1 /***********************************************************************/
5 /* Damien Doligez, projet Para, INRIA Rocquencourt */
7 /* Copyright 1996 Institut National de Recherche en Informatique et */
8 /* en Automatique. All rights reserved. This file is distributed */
9 /* under the terms of the GNU Library General Public License, with */
10 /* the special exception on linking described in file ../LICENSE. */
12 /***********************************************************************/
14 /* $Id: major_gc.h 8766 2008-01-11 11:55:36Z doligez $ */
16 #ifndef CAML_MAJOR_GC_H
17 #define CAML_MAJOR_GC_H
24 void *block; /* address of the malloced block this chunk live in */
25 asize_t alloc; /* in bytes, used for compaction */
26 asize_t size; /* in bytes */
30 #define Chunk_size(c) (((heap_chunk_head *) (c)) [-1]).size
31 #define Chunk_alloc(c) (((heap_chunk_head *) (c)) [-1]).alloc
32 #define Chunk_next(c) (((heap_chunk_head *) (c)) [-1]).next
33 #define Chunk_block(c) (((heap_chunk_head *) (c)) [-1]).block
35 extern int caml_gc_phase;
36 extern int caml_gc_subphase;
37 extern uintnat caml_allocated_words;
38 extern double caml_extra_heap_resources;
39 extern uintnat caml_dependent_size, caml_dependent_allocated;
40 extern uintnat caml_fl_size_at_phase_change;
45 #define Subphase_main 10
46 #define Subphase_weak1 11
47 #define Subphase_weak2 12
48 #define Subphase_final 13
50 CAMLextern char *caml_heap_start;
51 extern uintnat total_heap_size;
52 extern char *caml_gc_sweep_hp;
54 void caml_init_major_heap (asize_t); /* size in bytes */
55 asize_t caml_round_heap_chunk_size (asize_t); /* size in bytes */
56 void caml_darken (value, value *);
57 intnat caml_major_collection_slice (long);
58 void major_collection (void);
59 void caml_finish_major_cycle (void);
62 #endif /* CAML_MAJOR_GC_H */