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_MINOR_GC_H
|
|
|
|
#define CAML_MINOR_GC_H
|
1995-05-04 03:15:53 -07:00
|
|
|
|
|
|
|
|
|
|
|
#include "misc.h"
|
|
|
|
|
2003-12-31 06:20:40 -08:00
|
|
|
CAMLextern char *caml_young_start, *caml_young_ptr;
|
|
|
|
CAMLextern char *caml_young_end, *caml_young_limit;
|
|
|
|
CAMLextern value **caml_ref_table_ptr, **caml_ref_table_limit;
|
|
|
|
extern asize_t caml_minor_heap_size;
|
|
|
|
extern int caml_in_minor_collection;
|
1995-05-04 03:15:53 -07:00
|
|
|
|
|
|
|
#define Is_young(val) \
|
2002-01-20 09:39:10 -08:00
|
|
|
(Assert (Is_block (val)), \
|
2003-12-31 06:20:40 -08:00
|
|
|
(addr)(val) < (addr)caml_young_end && (addr)(val) > (addr)caml_young_start)
|
1995-05-04 03:15:53 -07:00
|
|
|
|
2003-12-31 06:20:40 -08:00
|
|
|
extern void caml_set_minor_heap_size (asize_t);
|
|
|
|
extern void caml_empty_minor_heap (void);
|
|
|
|
CAMLextern void caml_minor_collection (void);
|
|
|
|
CAMLextern void garbage_collection (void); /* def in asmrun/signals.c */
|
|
|
|
extern void caml_realloc_ref_table (void);
|
|
|
|
extern void caml_oldify_one (value, value *);
|
|
|
|
extern void caml_oldify_mopup (void);
|
2002-01-18 07:13:26 -08:00
|
|
|
|
|
|
|
#define Oldify(p) do{ \
|
|
|
|
value __oldify__v__ = *p; \
|
|
|
|
if (Is_block (__oldify__v__) && Is_young (__oldify__v__)){ \
|
2003-12-31 06:20:40 -08:00
|
|
|
caml_oldify_one (__oldify__v__, (p)); \
|
2002-01-18 07:13:26 -08:00
|
|
|
} \
|
|
|
|
}while(0)
|
1995-05-04 03:15:53 -07:00
|
|
|
|
2003-12-15 10:10:51 -08:00
|
|
|
#endif /* CAML_MINOR_GC_H */
|