From dda1522ab06b38919cd055d236f42fb7a392ec35 Mon Sep 17 00:00:00 2001 From: Andy Wingo Date: Wed, 2 Jul 2025 09:59:45 +0200 Subject: [PATCH] Add gc_can_move_objects() to gc-attrs.h --- api/bdw-attrs.h | 4 ++++ api/gc-attrs.h | 1 + api/mmc-attrs.h | 4 ++++ api/pcc-attrs.h | 4 ++++ api/semi-attrs.h | 4 ++++ 5 files changed, 17 insertions(+) diff --git a/api/bdw-attrs.h b/api/bdw-attrs.h index 7a68618cc..0f97c1340 100644 --- a/api/bdw-attrs.h +++ b/api/bdw-attrs.h @@ -92,4 +92,8 @@ static inline int gc_can_pin_objects(void) { return 1; } +static inline int gc_can_move_objects(void) { + return 0; +} + #endif // BDW_ATTRS_H diff --git a/api/gc-attrs.h b/api/gc-attrs.h index 1ce2c854b..eaba7f8bc 100644 --- a/api/gc-attrs.h +++ b/api/gc-attrs.h @@ -65,6 +65,7 @@ enum gc_cooperative_safepoint_kind { static inline enum gc_cooperative_safepoint_kind gc_cooperative_safepoint_kind(void) GC_ALWAYS_INLINE; static inline int gc_can_pin_objects(void) GC_ALWAYS_INLINE; +static inline int gc_can_move_objects(void) GC_ALWAYS_INLINE; #ifndef GC_IMPL #ifdef GC_ATTRS diff --git a/api/mmc-attrs.h b/api/mmc-attrs.h index 6e9b6487d..749674343 100644 --- a/api/mmc-attrs.h +++ b/api/mmc-attrs.h @@ -117,4 +117,8 @@ static inline int gc_can_pin_objects(void) { return 1; } +static inline int gc_can_move_objects(void) { + return GC_CONSERVATIVE_TRACE ? 0 : 1; +} + #endif // MMC_ATTRS_H diff --git a/api/pcc-attrs.h b/api/pcc-attrs.h index d7ec30768..905b5cd05 100644 --- a/api/pcc-attrs.h +++ b/api/pcc-attrs.h @@ -89,4 +89,8 @@ static inline int gc_can_pin_objects(void) { return 0; } +static inline int gc_can_move_objects(void) { + return 1; +} + #endif // PCC_ATTRS_H diff --git a/api/semi-attrs.h b/api/semi-attrs.h index fb4d7ab91..c04de3a0d 100644 --- a/api/semi-attrs.h +++ b/api/semi-attrs.h @@ -78,4 +78,8 @@ static inline int gc_can_pin_objects(void) { return 0; } +static inline int gc_can_move_objects(void) { + return 1; +} + #endif // SEMI_ATTRS_H