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 */
|
1995-08-09 08:06:35 -07:00
|
|
|
/* Automatique. Distributed only by permission. */
|
|
|
|
/* */
|
|
|
|
/***********************************************************************/
|
|
|
|
|
|
|
|
/* $Id$ */
|
|
|
|
|
1995-05-04 03:15:53 -07:00
|
|
|
#ifndef _major_gc_
|
|
|
|
#define _major_gc_
|
|
|
|
|
|
|
|
|
|
|
|
#include "freelist.h"
|
|
|
|
#include "misc.h"
|
|
|
|
|
|
|
|
typedef struct {
|
|
|
|
asize_t size;
|
|
|
|
char *next;
|
|
|
|
} heap_chunk_head;
|
|
|
|
|
|
|
|
extern int gc_phase;
|
|
|
|
extern unsigned long allocated_words;
|
|
|
|
extern unsigned long extra_heap_memory;
|
|
|
|
|
|
|
|
#define Phase_mark 0
|
|
|
|
#define Phase_sweep 1
|
|
|
|
|
1995-07-24 05:46:59 -07:00
|
|
|
#ifdef __alpha
|
|
|
|
typedef int page_table_entry;
|
|
|
|
#else
|
|
|
|
typedef char page_table_entry;
|
|
|
|
#endif
|
|
|
|
|
1995-05-04 03:15:53 -07:00
|
|
|
extern char *heap_start;
|
|
|
|
extern char *heap_end;
|
|
|
|
extern unsigned long total_heap_size;
|
1995-07-24 05:46:59 -07:00
|
|
|
extern page_table_entry *page_table;
|
1995-05-04 03:15:53 -07:00
|
|
|
extern asize_t page_table_size;
|
|
|
|
extern char *gc_sweep_hp;
|
|
|
|
|
|
|
|
#define In_heap 1
|
|
|
|
#define Not_in_heap 0
|
|
|
|
#define Page(p) (((addr) (p) - (addr) heap_start) >> Page_log)
|
|
|
|
#define Is_in_heap(p) \
|
|
|
|
((addr)(p) >= (addr)heap_start && (addr)(p) < (addr)heap_end \
|
1995-07-24 05:46:59 -07:00
|
|
|
&& page_table [Page (p)])
|
1995-05-04 03:15:53 -07:00
|
|
|
|
|
|
|
void init_major_heap P((asize_t));
|
|
|
|
asize_t round_heap_chunk_size P((asize_t));
|
|
|
|
void darken P((value));
|
|
|
|
void major_collection_slice P((void));
|
|
|
|
void major_collection P((void));
|
|
|
|
void finish_major_cycle P((void));
|
|
|
|
|
|
|
|
|
|
|
|
#endif /* _major_gc_ */
|