@@ -77,15 +77,15 @@ unsafe fn free(ptr: ObjPtr) {
77
77
impl CcSync {
78
78
/// _suggest_(may or may not) collector to collect garbage. return number of cyclic garbage being collected
79
79
#[ inline]
80
- pub fn gc ( & self ) -> usize {
80
+ pub fn gc ( & self ) -> usize {
81
81
if self . should_gc ( ) {
82
82
self . force_gc ( )
83
- } else {
83
+ } else {
84
84
0
85
85
}
86
86
}
87
87
#[ inline]
88
- pub fn force_gc ( & self ) -> usize {
88
+ pub fn force_gc ( & self ) -> usize {
89
89
self . collect_cycles ( )
90
90
}
91
91
fn roots_len ( & self ) -> usize {
@@ -96,7 +96,7 @@ impl CcSync {
96
96
self . roots_len ( ) > 100
97
97
}
98
98
pub fn increment ( & self , obj : ObjRef ) {
99
- if obj. header ( ) . is_leaked ( ) {
99
+ if obj. header ( ) . is_leaked ( ) {
100
100
// by define a leaked object's rc should not change?
101
101
return ;
102
102
}
@@ -159,7 +159,7 @@ impl CcSync {
159
159
}
160
160
}
161
161
162
- fn collect_cycles ( & self ) ->usize {
162
+ fn collect_cycles ( & self ) -> usize {
163
163
if IS_GC_THREAD . with ( |v| v. get ( ) ) {
164
164
return 0 ;
165
165
// already call collect_cycle() once
@@ -218,7 +218,7 @@ impl CcSync {
218
218
} )
219
219
. count ( ) ;
220
220
}
221
- fn collect_roots ( & self , lock : MutexGuard < ( ) > ) ->usize {
221
+ fn collect_roots ( & self , lock : MutexGuard < ( ) > ) -> usize {
222
222
// Collecting the nodes into this Vec is difference from the original
223
223
// Bacon-Rajan paper. We need this because we have destructors(RAII) and
224
224
// running them during traversal will cause cycles to be broken which
0 commit comments