mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-05-10 15:50:50 +02:00
gc_init takes const gc_options
This commit is contained in:
parent
8edfd42ca1
commit
c42c538aaa
4 changed files with 7 additions and 6 deletions
2
bdw.c
2
bdw.c
|
@ -240,7 +240,7 @@ int gc_options_parse_and_set(struct gc_options *options, int option,
|
||||||
return gc_common_options_parse_and_set(&options->common, option, value);
|
return gc_common_options_parse_and_set(&options->common, option, value);
|
||||||
}
|
}
|
||||||
|
|
||||||
int gc_init(struct gc_options *options, struct gc_stack_addr *stack_base,
|
int gc_init(const struct gc_options *options, struct gc_stack_addr *stack_base,
|
||||||
struct gc_heap **heap, struct gc_mutator **mutator) {
|
struct gc_heap **heap, struct gc_mutator **mutator) {
|
||||||
GC_ASSERT_EQ(gc_allocator_small_granule_size(), GC_INLINE_GRANULE_BYTES);
|
GC_ASSERT_EQ(gc_allocator_small_granule_size(), GC_INLINE_GRANULE_BYTES);
|
||||||
GC_ASSERT_EQ(gc_allocator_large_threshold(),
|
GC_ASSERT_EQ(gc_allocator_large_threshold(),
|
||||||
|
|
5
gc-api.h
5
gc-api.h
|
@ -22,8 +22,9 @@ GC_API_ void* gc_call_with_stack_addr(void* (*f)(struct gc_stack_addr *,
|
||||||
void *),
|
void *),
|
||||||
void *data) GC_NEVER_INLINE;
|
void *data) GC_NEVER_INLINE;
|
||||||
|
|
||||||
GC_API_ int gc_init(struct gc_options *options, struct gc_stack_addr *base,
|
GC_API_ int gc_init(const struct gc_options *options,
|
||||||
struct gc_heap **heap, struct gc_mutator **mutator);
|
struct gc_stack_addr *base, struct gc_heap **heap,
|
||||||
|
struct gc_mutator **mutator);
|
||||||
|
|
||||||
struct gc_mutator_roots;
|
struct gc_mutator_roots;
|
||||||
GC_API_ void gc_mutator_set_roots(struct gc_mutator *mut,
|
GC_API_ void gc_mutator_set_roots(struct gc_mutator *mut,
|
||||||
|
|
2
semi.c
2
semi.c
|
@ -408,7 +408,7 @@ int gc_options_parse_and_set(struct gc_options *options, int option,
|
||||||
return gc_common_options_parse_and_set(&options->common, option, value);
|
return gc_common_options_parse_and_set(&options->common, option, value);
|
||||||
}
|
}
|
||||||
|
|
||||||
int gc_init(struct gc_options *options, struct gc_stack_addr *stack_base,
|
int gc_init(const struct gc_options *options, struct gc_stack_addr *stack_base,
|
||||||
struct gc_heap **heap, struct gc_mutator **mut) {
|
struct gc_heap **heap, struct gc_mutator **mut) {
|
||||||
GC_ASSERT_EQ(gc_allocator_allocation_pointer_offset(),
|
GC_ASSERT_EQ(gc_allocator_allocation_pointer_offset(),
|
||||||
offsetof(struct semi_space, hp));
|
offsetof(struct semi_space, hp));
|
||||||
|
|
|
@ -2258,7 +2258,7 @@ int gc_options_parse_and_set(struct gc_options *options, int option,
|
||||||
return gc_common_options_parse_and_set(&options->common, option, value);
|
return gc_common_options_parse_and_set(&options->common, option, value);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int heap_init(struct gc_heap *heap, struct gc_options *options) {
|
static int heap_init(struct gc_heap *heap, const struct gc_options *options) {
|
||||||
// *heap is already initialized to 0.
|
// *heap is already initialized to 0.
|
||||||
|
|
||||||
pthread_mutex_init(&heap->lock, NULL);
|
pthread_mutex_init(&heap->lock, NULL);
|
||||||
|
@ -2316,7 +2316,7 @@ static int mark_space_init(struct mark_space *space, struct gc_heap *heap) {
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
int gc_init(struct gc_options *options, struct gc_stack_addr *stack_base,
|
int gc_init(const struct gc_options *options, struct gc_stack_addr *stack_base,
|
||||||
struct gc_heap **heap, struct gc_mutator **mut) {
|
struct gc_heap **heap, struct gc_mutator **mut) {
|
||||||
GC_ASSERT_EQ(gc_allocator_small_granule_size(), GRANULE_SIZE);
|
GC_ASSERT_EQ(gc_allocator_small_granule_size(), GRANULE_SIZE);
|
||||||
GC_ASSERT_EQ(gc_allocator_large_threshold(), LARGE_OBJECT_THRESHOLD);
|
GC_ASSERT_EQ(gc_allocator_large_threshold(), LARGE_OBJECT_THRESHOLD);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue