1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-06-18 01:30:27 +02:00

Implement per-object pinning API

Fixes https://github.com/wingo/whippet/issues/6.
This commit is contained in:
Andy Wingo 2024-09-18 10:32:38 +02:00
parent a722b9c13f
commit 9f26dbb1fc
13 changed files with 81 additions and 5 deletions

View file

@ -54,4 +54,8 @@ static inline enum gc_safepoint_mechanism gc_safepoint_mechanism(void) {
return GC_SAFEPOINT_MECHANISM_SIGNAL;
}
static inline int gc_can_pin_objects(void) {
return 1;
}
#endif // BDW_ATTRS_H

View file

@ -206,4 +206,6 @@ static inline void gc_write_barrier(struct gc_ref obj, size_t obj_size,
}
}
GC_API_ void gc_pin_object(struct gc_mutator *mut, struct gc_ref obj);
#endif // GC_API_H_

View file

@ -43,4 +43,6 @@ enum gc_safepoint_mechanism {
};
static inline enum gc_safepoint_mechanism gc_safepoint_mechanism(void) GC_ALWAYS_INLINE;
static inline int gc_can_pin_objects(void) GC_ALWAYS_INLINE;
#endif // GC_ATTRS_H

View file

@ -61,4 +61,8 @@ static inline enum gc_safepoint_mechanism gc_safepoint_mechanism(void) {
return GC_SAFEPOINT_MECHANISM_COOPERATIVE;
}
static inline int gc_can_pin_objects(void) {
return 1;
}
#endif // MMC_ATTRS_H

View file

@ -57,4 +57,8 @@ static inline enum gc_safepoint_mechanism gc_safepoint_mechanism(void) {
return GC_SAFEPOINT_MECHANISM_COOPERATIVE;
}
static inline int gc_can_pin_objects(void) {
return 0;
}
#endif // PCC_ATTRS_H

View file

@ -56,4 +56,8 @@ static inline enum gc_safepoint_mechanism gc_safepoint_mechanism(void) {
return GC_SAFEPOINT_MECHANISM_COOPERATIVE;
}
static inline int gc_can_pin_objects(void) {
return 0;
}
#endif // SEMI_ATTRS_H