-
-
Notifications
You must be signed in to change notification settings - Fork 606
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
sched: free aligned_alloc() with free()
Memory allocated with aligned_alloc() should be freed with free(), not with delete - although in our actual implemention those are really the same thing. gcc 11 warns about using sched::thread::make() - which uses align_alloc() - and the deleting it with "delete", using std::unique_ptr. Gcc only warns about this issue in sched.cc so we only fix that file, but note that other places of the code also have unique_ptr<thread> and should eventually use a similar fix. The fix is a new method sched::thread::make_unique<> which returns a std::unique_ptr that holds a thread a knows how to properly delete it. Signed-off-by: Nadav Har'El <[email protected]> Message-Id: <[email protected]>
- Loading branch information
Showing
2 changed files
with
19 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters