1995-08-09 08:06:35 -07:00
|
|
|
/***********************************************************************/
|
|
|
|
/* */
|
1996-04-30 07:53:58 -07:00
|
|
|
/* Objective Caml */
|
1995-08-09 08:06:35 -07:00
|
|
|
/* */
|
|
|
|
/* Damien Doligez, projet Para, INRIA Rocquencourt */
|
|
|
|
/* */
|
1996-04-30 07:53:58 -07:00
|
|
|
/* Copyright 1996 Institut National de Recherche en Informatique et */
|
1999-11-17 10:59:06 -08:00
|
|
|
/* en Automatique. All rights reserved. This file is distributed */
|
2001-12-07 05:41:02 -08:00
|
|
|
/* under the terms of the GNU Library General Public License, with */
|
|
|
|
/* the special exception on linking described in file ../LICENSE. */
|
1995-08-09 08:06:35 -07:00
|
|
|
/* */
|
|
|
|
/***********************************************************************/
|
|
|
|
|
|
|
|
/* $Id$ */
|
|
|
|
|
2003-12-15 10:10:51 -08:00
|
|
|
#ifndef CAML_GC_H
|
|
|
|
#define CAML_GC_H
|
1995-05-04 03:15:53 -07:00
|
|
|
|
|
|
|
|
|
|
|
#include "mlvalues.h"
|
|
|
|
|
2000-01-02 08:10:00 -08:00
|
|
|
#define Caml_white (0 << 8)
|
|
|
|
#define Caml_gray (1 << 8)
|
|
|
|
#define Caml_blue (2 << 8)
|
|
|
|
#define Caml_black (3 << 8)
|
1995-05-04 03:15:53 -07:00
|
|
|
|
2000-01-02 08:10:00 -08:00
|
|
|
#define Color_hd(hd) ((color_t) ((hd) & Caml_black))
|
2002-02-19 05:29:09 -08:00
|
|
|
#define Color_hp(hp) (Color_hd (Hd_hp (hp)))
|
2001-12-13 05:12:04 -08:00
|
|
|
#define Color_val(val) (Color_hd (Hd_val (val)))
|
1995-05-04 03:15:53 -07:00
|
|
|
|
2000-01-02 08:10:00 -08:00
|
|
|
#define Is_white_hd(hd) (Color_hd (hd) == Caml_white)
|
|
|
|
#define Is_gray_hd(hd) (Color_hd (hd) == Caml_gray)
|
|
|
|
#define Is_blue_hd(hd) (Color_hd (hd) == Caml_blue)
|
|
|
|
#define Is_black_hd(hd) (Color_hd (hd) == Caml_black)
|
1995-05-04 03:15:53 -07:00
|
|
|
|
2000-01-02 08:10:00 -08:00
|
|
|
#define Whitehd_hd(hd) (((hd) & ~Caml_black)/*| Caml_white*/)
|
|
|
|
#define Grayhd_hd(hd) (((hd) & ~Caml_black) | Caml_gray)
|
|
|
|
#define Blackhd_hd(hd) (((hd)/*& ~Caml_black*/)| Caml_black)
|
|
|
|
#define Bluehd_hd(hd) (((hd) & ~Caml_black) | Caml_blue)
|
1995-05-04 03:15:53 -07:00
|
|
|
|
|
|
|
/* This depends on the layout of the header. See [mlvalues.h]. */
|
1997-05-19 08:42:21 -07:00
|
|
|
#define Make_header(wosize, tag, color) \
|
2002-12-16 08:42:13 -08:00
|
|
|
(/*Assert ((wosize) <= Max_wosize),*/ \
|
1997-05-19 08:42:21 -07:00
|
|
|
((header_t) (((header_t) (wosize) << 10) \
|
|
|
|
+ (color) \
|
2002-12-12 10:59:11 -08:00
|
|
|
+ (tag_t) (tag))) \
|
|
|
|
)
|
1995-05-04 03:15:53 -07:00
|
|
|
|
2000-01-02 08:10:00 -08:00
|
|
|
#define Is_white_val(val) (Color_val(val) == Caml_white)
|
|
|
|
#define Is_gray_val(val) (Color_val(val) == Caml_gray)
|
|
|
|
#define Is_blue_val(val) (Color_val(val) == Caml_blue)
|
|
|
|
#define Is_black_val(val) (Color_val(val) == Caml_black)
|
1995-05-04 03:15:53 -07:00
|
|
|
|
|
|
|
|
2003-12-15 10:10:51 -08:00
|
|
|
#endif /* CAML_GC_H */
|