[vm] Fix vm ref trace function definition (#15247)
diff --git a/runtime/src/iree/vm/ref.c b/runtime/src/iree/vm/ref.c
index e610157..69c77d4 100644
--- a/runtime/src/iree/vm/ref.c
+++ b/runtime/src/iree/vm/ref.c
@@ -12,11 +12,17 @@
// Useful debugging tool:
#if 0
+static inline volatile iree_atomic_ref_count_t* iree_vm_get_raw_counter_ptr(
+ void* ptr, iree_vm_ref_type_t type);
+
+static inline volatile iree_atomic_ref_count_t* iree_vm_get_ref_counter_ptr(
+ iree_vm_ref_t* ref);
+
static void iree_vm_ref_trace(const char* msg, iree_vm_ref_t* ref) {
volatile iree_atomic_ref_count_t* counter = iree_vm_get_ref_counter_ptr(ref);
iree_string_view_t name = iree_vm_ref_type_name(ref->type);
fprintf(stderr, "%s %.*s 0x%p %d\n", msg, (int)name.size, name.data, ref->ptr,
- counter->__val);
+ iree_atomic_ref_count_load(counter));
}
static void iree_vm_ref_ptr_trace(const char* msg, void* ptr,
iree_vm_ref_type_t type) {
@@ -24,7 +30,7 @@
iree_vm_get_raw_counter_ptr(ptr, type);
iree_string_view_t name = iree_vm_ref_type_name(type);
fprintf(stderr, "%s %.*s 0x%p %d\n", msg, (int)name.size, name.data, ptr,
- counter->__val);
+ iree_atomic_ref_count_load(counter));
}
#else
#define iree_vm_ref_trace(...)