File: gc_ctrl.h

package info (click to toggle)
ocaml 5.4.0-3
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 44,372 kB
  • sloc: ml: 370,196; ansic: 52,820; sh: 27,396; asm: 5,462; makefile: 3,679; python: 974; awk: 278; javascript: 273; perl: 59; fortran: 21; cs: 9
file content (54 lines) | stat: -rw-r--r-- 2,328 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
/**************************************************************************/
/*                                                                        */
/*                                 OCaml                                  */
/*                                                                        */
/*              Damien Doligez, projet Para, INRIA Rocquencourt           */
/*                                                                        */
/*   Copyright 1996 Institut National de Recherche en Informatique et     */
/*     en Automatique.                                                    */
/*                                                                        */
/*   All rights reserved.  This file is distributed under the terms of    */
/*   the GNU Lesser General Public License version 2.1, with the          */
/*   special exception on linking described in the file LICENSE.          */
/*                                                                        */
/**************************************************************************/

#ifndef CAML_GC_CTRL_H
#define CAML_GC_CTRL_H

#ifdef CAML_INTERNALS

#include "misc.h"

CAMLextern atomic_uintnat caml_max_stack_wsize;
CAMLextern uintnat caml_fiber_wsz;
CAMLextern uintnat caml_major_cycles_completed;

void caml_init_gc (void);
value caml_gc_stat(value);
value caml_gc_major(value);


#define caml_stat_top_heap_wsz caml_top_heap_words(Caml_state->shared_heap)
#define caml_stat_compactions 0
#define caml_stat_heap_wsz Wsize_bsize(caml_heap_size(Caml_state->shared_heap))
#define caml_stat_heap_chunks caml_heap_blocks(Caml_state->shared_heap)
#define caml_stat_major_collections caml_major_cycles_completed
#define caml_stat_promoted_words Caml_state->stat_promoted_words
#define caml_allocated_words Caml_state->allocated_words
#define caml_stat_major_words Caml_state->stat_major_words
#define caml_stat_minor_words Caml_state->stat_minor_words

#ifdef DEBUG
void caml_heap_check (void);
#endif

/* See the documentation of [Gc.ramp_up] in the standard library. */
caml_result caml_gc_ramp_up(value callback, uintnat *out_suspended_work);

/* See the documentation of [Gc.ramp_down] in the standard library. */
void caml_gc_ramp_down(uintnat suspended_ramp_up_words);

#endif /* CAML_INTERNALS */

#endif /* CAML_GC_CTRL_H */