|
static double | mytime () |
|
PN_SIZE | potion_stack_len (Potion *P, _PN **p) |
|
static
ATTRIBUTE_NO_ADDRESS_SAFETY_ANALYSIS
PN_SIZE | pngc_mark_array (Potion *P, register _PN *x, register long n, int type) |
|
ATTRIBUTE_NO_ADDRESS_SAFETY_ANALYSIS
PN_SIZE | potion_mark_stack (Potion *P, int type) |
|
void * | pngc_page_new (int *sz, const char exec) |
|
void | pngc_page_delete (void *mem, int sz) |
|
static int | NEW_BIRTH_REGION (struct PNMemory *M, void **wb, int sz) |
|
static int | potion_gc_minor (Potion *P, int sz) |
|
static int | potion_gc_major (Potion *P, int siz) |
|
void | potion_garbagecollect (Potion *P, int sz, int full) |
|
PN_SIZE | potion_type_size (Potion *P, const struct PNObject *ptr) |
|
void * | potion_gc_copy (Potion *P, struct PNObject *ptr) |
|
void * | potion_mark_minor (Potion *P, const struct PNObject *ptr) |
|
void * | potion_mark_major (Potion *P, const struct PNObject *ptr) |
|
Potion * | potion_gc_boot (void *sp) |
|
void | potion_gc_release (Potion *P) |
|
PN | potion_gc_actual (Potion *P, PN cl, PN self) |
|
PN | potion_gc_fixed (Potion *P, PN cl, PN self) |
|
PN | potion_gc_reserved (Potion *P, PN cl, PN self) |
|
Generational copying garbage collector, non-precise with Cheney loop.
Heavily based on Qish, a lightweight copying generational GC by Basile Starynkevitch. http://starynkevitch.net/Basile/qishintro.html
(c) 2008 why the lucky stiff, the freelance professor
Definition in file gc.c.
Potion* potion_gc_boot |
( |
void * |
sp | ) |
|
- Potion's GC is a generational copying GC. This is why the volatile keyword is used so liberally throughout the source code. PN types may suddenly move during any collection phase. They move from the birth area to the old area.
Potion actually begins by allocating an old area. This is for two reasons. First, the script may be too short to require an old area, so we want to avoid allocating two areas to start with. And second, since Potion loads its core classes into GC first, we save ourselves a severe promotion step by beginning with an automatic promotion to second generation. (Oh and this allows the core Potion struct pointer to be non-volatile.)
In short, this first page is never released, since the GC struct itself is on that page.
While this may pay a slight penalty in memory size for long-running scripts, perhaps I could add some occassional compaction to solve that as well.
- See also
- potion_init() which calls GC_PROTECT()
Definition at line 658 of file gc.c.