From c50c1767de51e8354a90cb4e680330182e3eb921 Mon Sep 17 00:00:00 2001 From: Jake Hughes Date: Thu, 9 May 2024 16:54:05 +0100 Subject: [PATCH] Add API for retrieving finaliser counts --- library/bdwgc/src/lib.rs | 2 ++ library/std/src/gc.rs | 3 +++ src/bdwgc | 2 +- 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/library/bdwgc/src/lib.rs b/library/bdwgc/src/lib.rs index 76064af9c4303..dbb732a1e8d78 100644 --- a/library/bdwgc/src/lib.rs +++ b/library/bdwgc/src/lib.rs @@ -88,4 +88,6 @@ extern "C" { pub fn GC_init_tls_rootset(rootset: *mut u8); pub fn GC_ignore_warn_proc(proc: *mut u8, word: usize); + + pub fn GC_finalized_total() -> u64; } diff --git a/library/std/src/gc.rs b/library/std/src/gc.rs index 737cf2ac84a95..7af0e547c25d5 100644 --- a/library/std/src/gc.rs +++ b/library/std/src/gc.rs @@ -181,6 +181,9 @@ impl GcAllocator { //////////////////////////////////////////////////////////////////////////////// // Free functions //////////////////////////////////////////////////////////////////////////////// +pub fn finalized_total() -> u64 { + unsafe { bdwgc::GC_finalized_total() } +} pub fn init() { unsafe { bdwgc::GC_set_markers_count(1) } diff --git a/src/bdwgc b/src/bdwgc index 9bfdaa2aeaf7a..be14dd1e8ee84 160000 --- a/src/bdwgc +++ b/src/bdwgc @@ -1 +1 @@ -Subproject commit 9bfdaa2aeaf7a2becb18f72e5c9bc147a039baae +Subproject commit be14dd1e8ee84ef93b1a7eec565ea79b10fc3a9c