1 /* This file is part of NIT ( http://www.nitlanguage.org ).
3 * Copyright 2009 Julien Chevalier <chevjulien@gmail.com>
5 * This file is free software, which comes along with NIT. This software is
6 * distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
7 * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
8 * PARTICULAR PURPOSE. You can modify it is you want, provided this header
9 * is kept unaltered, and a notification of the changes is added.
10 * You are allowed to redistribute it and sell it, alone or is a part of
20 #include "nit_common.h"
21 #include "gc_static_objects_list.h"
23 /* Markbit manipulations */
24 #define GET_MARKBIT(x) (((val_t)((x)[0].vft)) & 1)
25 #define SET_MARKBIT(x) ((x)->vft = (void*)(((bigint)((x)->vft)) | 1))
26 #define REMOVE_MARKBIT(x) ((x) ^ 1)
28 #define HEAP_ACTIVE_SIZE_MIN 3000
35 typedef struct TBOX_struct
{
36 const classtable_elt_t
*vft
;
43 char *allocationPointer
;
44 char *evacuationPointer
;
45 char *scavengingPointer
;
47 unsigned long heapActiveUsedSize
;
49 GC_List staticObjects
;
51 void Nit_gc_init(void);
53 val_t
GC_evacuation(obj_t object
);
55 void GC_scavenging(void);
57 void* Nit_gc_malloc(size_t size
);
59 void GC_add_static_object(val_t
*pointer
);