mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-06-07 04:30:18 +02:00
Implement per-object pinning API
Fixes https://github.com/wingo/whippet/issues/6.
This commit is contained in:
parent
a722b9c13f
commit
9f26dbb1fc
13 changed files with 81 additions and 5 deletions
|
@ -880,6 +880,14 @@ gc_allocate_pointerless(struct gc_mutator *mut, size_t size) {
|
|||
return gc_allocate(mut, size);
|
||||
}
|
||||
|
||||
void
|
||||
gc_pin_object(struct gc_mutator *mut, struct gc_ref ref) {
|
||||
struct nofl_space *nofl = heap_nofl_space(mutator_heap(mut));
|
||||
if (nofl_space_contains(nofl, ref))
|
||||
nofl_space_pin_object(nofl, ref);
|
||||
// Otherwise if it's a large or external object, it won't move.
|
||||
}
|
||||
|
||||
void
|
||||
gc_write_barrier_extern(struct gc_ref obj, size_t obj_size,
|
||||
struct gc_edge edge, struct gc_ref new_val) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue