1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
//! Finalizer support for garbage-collected objects.
/// Trait for objects that need custom finalization before being dropped.
///
/// Objects implementing this trait will have their `finalize` method called
/// during the garbage collection sweep phase, before the object is deallocated.
/// This allows for custom cleanup logic such as closing file handles, releasing
/// system resources, or performing other cleanup operations.
///
/// # Safety
///
/// The `finalize` method should not:
/// - Access other garbage-collected objects (they may already be finalized)
/// - Allocate new Gc objects
/// - Perform long-running operations (this blocks the GC)
/// - Panic (this will abort the program)
///
/// The finalize method is called at most once per object.
/// Internal wrapper for finalizer functions
pub type FinalizerFn = ;
/// Creates a finalizer function for an object that implements Finalize
pub