diff options
author | Xavier Leroy <xavier.leroy@inria.fr> | 1995-05-04 10:15:53 +0000 |
---|---|---|
committer | Xavier Leroy <xavier.leroy@inria.fr> | 1995-05-04 10:15:53 +0000 |
commit | 61bd8ace6bdb2652f4d51d64e3239a7105f56c26 (patch) | |
tree | e8b957df0957c1b483d41d68973824e280445548 /byterun/gc.h | |
parent | 8f9ea2a7b886e3e0a5cfd76b11fe79d083a7f20c (diff) |
Passage a la version bootstrappee (franchissement du Rubicon)
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@2 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
Diffstat (limited to 'byterun/gc.h')
-rw-r--r-- | byterun/gc.h | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/byterun/gc.h b/byterun/gc.h new file mode 100644 index 000000000..b772f2f28 --- /dev/null +++ b/byterun/gc.h @@ -0,0 +1,42 @@ +#ifndef _gc_ +#define _gc_ + + +#include "mlvalues.h" + +/* Defined in [major_gc.c]. */ +extern unsigned free_mem_percent_min, free_mem_percent_max; + +#define White (0 << 8) +#define Gray (1 << 8) +#define Blue (2 << 8) +#define Black (3 << 8) + +#define Color_hd(hd) ((color_t) ((hd) & Black)) +#define Color_hp(hp) Color_hd (Hd_hp (hp)) + +#define Is_white_hd(hd) (Color_hd (hd) == White) +#define Is_gray_hd(hd) (Color_hd (hd) == Gray) +#define Is_blue_hd(hd) (Color_hd (hd) == Blue) +#define Is_black_hd(hd) (Color_hd (hd) == Black) + +#define Whitehd_hd(hd) ((hd) & ~Black) +#define Grayhd_hd(hd) (((hd) & ~Black) | Gray) +#define Blackhd_hd(hd) ((hd) | Black) +#define Bluehd_hd(hd) (((hd) & ~Black) | Blue) + +/* This depends on the layout of the header. See [mlvalues.h]. */ +#define Make_header(wosize, tag, color) \ + ((header_t) (((header_t) (wosize) << 10) \ + + (color) \ + + (tag_t) (tag))) + +#define Color_val(val) (Color_hd (Hd_val (val))) + +#define Is_white_val(val) (Color_val(val) == White) +#define Is_gray_val(val) (Color_val(val) == Gray) +#define Is_blue_val(val) (Color_val(val) == Blue) +#define Is_black_val(val) (Color_val(val) == Black) + + +#endif /* _gc_ */ |