mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-06-09 21:40:33 +02:00
Add parallel copying collector
This commit is contained in:
parent
c226570a81
commit
d5ef140dfe
5 changed files with 1115 additions and 0 deletions
4
Makefile
4
Makefile
|
@ -2,6 +2,7 @@ TESTS = quads mt-gcbench ephemerons # MT_GCBench MT_GCBench2
|
|||
COLLECTORS = \
|
||||
bdw \
|
||||
semi \
|
||||
pcc \
|
||||
\
|
||||
whippet \
|
||||
stack-conservative-whippet \
|
||||
|
@ -60,6 +61,9 @@ GC_LIBS_bdw = `pkg-config --libs bdw-gc`
|
|||
GC_STEM_semi = semi
|
||||
GC_CFLAGS_semi = -DGC_PRECISE_ROOTS=1
|
||||
|
||||
GC_STEM_pcc = pcc
|
||||
GC_CFLAGS_pcc = -DGC_PRECISE_ROOTS=1 -DGC_PARALLEL=1
|
||||
|
||||
define whippet_variant
|
||||
GC_STEM_$(1) = whippet
|
||||
GC_CFLAGS_$(1) = $(2)
|
||||
|
|
60
api/pcc-attrs.h
Normal file
60
api/pcc-attrs.h
Normal file
|
@ -0,0 +1,60 @@
|
|||
#ifndef PCC_ATTRS_H
|
||||
#define PCC_ATTRS_H
|
||||
|
||||
#include "gc-config.h"
|
||||
#include "gc-assert.h"
|
||||
#include "gc-attrs.h"
|
||||
|
||||
static const uintptr_t GC_ALIGNMENT = 8;
|
||||
static const size_t GC_LARGE_OBJECT_THRESHOLD = 8192;
|
||||
|
||||
static inline enum gc_allocator_kind gc_allocator_kind(void) {
|
||||
return GC_ALLOCATOR_INLINE_BUMP_POINTER;
|
||||
}
|
||||
static inline size_t gc_allocator_small_granule_size(void) {
|
||||
return GC_ALIGNMENT;
|
||||
}
|
||||
static inline size_t gc_allocator_large_threshold(void) {
|
||||
return GC_LARGE_OBJECT_THRESHOLD;
|
||||
}
|
||||
|
||||
static inline size_t gc_allocator_allocation_pointer_offset(void) {
|
||||
return sizeof(uintptr_t) * 0;
|
||||
}
|
||||
static inline size_t gc_allocator_allocation_limit_offset(void) {
|
||||
return sizeof(uintptr_t) * 1;
|
||||
}
|
||||
|
||||
static inline size_t gc_allocator_freelist_offset(size_t size) {
|
||||
GC_CRASH();
|
||||
}
|
||||
|
||||
static inline size_t gc_allocator_alloc_table_alignment(void) {
|
||||
return 0;
|
||||
}
|
||||
static inline uint8_t gc_allocator_alloc_table_begin_pattern(void) {
|
||||
GC_CRASH();
|
||||
}
|
||||
static inline uint8_t gc_allocator_alloc_table_end_pattern(void) {
|
||||
GC_CRASH();
|
||||
}
|
||||
|
||||
static inline int gc_allocator_needs_clear(void) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
static inline enum gc_write_barrier_kind gc_write_barrier_kind(size_t obj_size) {
|
||||
return GC_WRITE_BARRIER_NONE;
|
||||
}
|
||||
static inline size_t gc_write_barrier_card_table_alignment(void) {
|
||||
GC_CRASH();
|
||||
}
|
||||
static inline size_t gc_write_barrier_card_size(void) {
|
||||
GC_CRASH();
|
||||
}
|
||||
|
||||
static inline enum gc_safepoint_mechanism gc_safepoint_mechanism(void) {
|
||||
return GC_SAFEPOINT_MECHANISM_COOPERATIVE;
|
||||
}
|
||||
|
||||
#endif // PCC_ATTRS_H
|
3
embed.mk
3
embed.mk
|
@ -40,6 +40,9 @@ GC_LIBS_bdw = `pkg-config --libs bdw-gc`
|
|||
GC_STEM_semi = semi
|
||||
GC_CFLAGS_semi = -DGC_PRECISE_ROOTS=1
|
||||
|
||||
GC_STEM_pcc = pcc
|
||||
GC_CFLAGS_pcc = -DGC_PRECISE_ROOTS=1 -DGC_PARALLEL=1
|
||||
|
||||
define whippet_variant
|
||||
GC_STEM_$(1) = whippet
|
||||
GC_CFLAGS_$(1) = $(2)
|
||||
|
|
|
@ -58,6 +58,11 @@ static size_t large_object_space_npages(struct large_object_space *space,
|
|||
return (bytes + space->page_size - 1) >> space->page_size_log2;
|
||||
}
|
||||
|
||||
static size_t
|
||||
large_object_space_size_at_last_collection(struct large_object_space *space) {
|
||||
return space->live_pages_at_last_collection << space->page_size_log2;
|
||||
}
|
||||
|
||||
static void large_object_space_clear_one_remembered(uintptr_t addr,
|
||||
void *unused) {
|
||||
struct gc_ref ref = gc_ref(addr);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue