@@ -1320,13 +1320,7 @@ impl GC {
13201320 LuaValueKind :: Table => {
13211321 if let Some ( id) = value. as_table_id ( ) {
13221322 if let Some ( t) = pool. tables . get ( id. 0 ) {
1323- let is_white = t. header . is_white ( ) ;
1324- let is_fixed = t. header . is_fixed ( ) ;
1325- eprintln ! (
1326- "[GC] is_value_dead: table {} is_white={} is_fixed={}" ,
1327- id. 0 , is_white, is_fixed
1328- ) ;
1329- return !is_fixed && is_white;
1323+ return !t. header . is_fixed ( ) && t. header . is_white ( ) ;
13301324 }
13311325 }
13321326 false
@@ -1366,7 +1360,6 @@ impl GC {
13661360 // Collect tables with weak mode and their entries to remove
13671361 let mut tables_to_clear: Vec < ( u32 , Vec < LuaValue > ) > = Vec :: new ( ) ;
13681362 let mut total_cleared = 0 ;
1369- let mut weak_tables_found = 0 ;
13701363
13711364 for ( id, table) in pool. tables . iter ( ) {
13721365 // Check if this table has a metatable with __mode
@@ -1375,21 +1368,12 @@ impl GC {
13751368 // Look for __mode key in metatable
13761369 let mode = self . get_weak_mode ( mt, pool) ;
13771370 if let Some ( ( weak_keys, weak_values) ) = mode {
1378- weak_tables_found += 1 ;
13791371 // Collect keys to remove
13801372 let mut keys_to_remove = Vec :: new ( ) ;
13811373 for ( key, value) in table. data . iter_all ( ) {
13821374 let key_dead = weak_keys && self . is_value_dead ( & key, pool) ;
13831375 let value_dead = weak_values && self . is_value_dead ( & value, pool) ;
13841376
1385- // Debug: print value status
1386- if weak_values {
1387- eprintln ! (
1388- "[GC] weak table entry: value_dead={}, value={:?}" ,
1389- value_dead, value
1390- ) ;
1391- }
1392-
13931377 if key_dead || value_dead {
13941378 keys_to_remove. push ( key) ;
13951379 }
@@ -1402,8 +1386,6 @@ impl GC {
14021386 }
14031387 }
14041388
1405- eprintln ! ( "[GC] found {} weak tables" , weak_tables_found) ;
1406-
14071389 // Now actually remove the entries
14081390 for ( table_id, keys) in tables_to_clear {
14091391 if let Some ( table) = pool. tables . get_mut ( table_id) {
0 commit comments