Landing: 10a4ba553e6a

Project / Subsystem

gcc / sched-deps

Date

2026-07-27

Author

Kyrylo Tkachov

Commit

10a4ba553e6a693b5a75c0a6f67c30989efda307

Source

github

Perf win

No

Breaking

No

All attributes

project
gcc
subsystem
sched-deps
patch_id
—
commit_hash
10a4ba553e6a693b5a75c0a6f67c30989efda307
source_type
github
headline
sched-deps: Clear dependency caches before freeing them
tldr
Fixes memory leaks in sched-deps by ensuring dependency cache bitmaps are cleared before cache arrays are freed.
author
Kyrylo Tkachov
outcome
committed
performance_win
false
breaking_change
false
series_id
—
series_parts
[]
tags
  • • optimization
  • • scheduler
  • • memory management
discussion_id_link
—
bugzilla_pr
—
date
2026-07-27T00:00:00.000Z

This commit corrects a memory leak in the sched-deps component by ensuring that dependency cache bitmaps are properly cleared before the associated cache arrays are freed. Previously, sched_deps_finish reset cache_size prematurely, causing the cleanup loop to iterate zero times. This resulted in the cache arrays being freed without their bitmap elements being returned to the obstack. The fix moves the cache_size reset to after the cleanup loop, guaranteeing that all allocated memory is reclaimed.