aboutsummaryrefslogtreecommitdiff
path: root/src/core/cpu_manager.h
diff options
context:
space:
mode:
authorbunnei <bunneidev@gmail.com>2021-02-27 11:56:04 -0800
committerbunnei <bunneidev@gmail.com>2021-02-27 11:56:04 -0800
commit3322f10f84e5e6c57a5d88707566e85227b0e624 (patch)
tree89cd2ad6dfb310587aa546bb7b9847762795f08f /src/core/cpu_manager.h
parentcfe967f1ac788132926c1b11d251892d78f8229b (diff)
core: Switch to unique_ptr for usage of Common::Fiber.
- With using unique_ptr instead of shared_ptr, we have more explicit ownership of the context. - Fixes a memory leak due to circular reference of the shared pointer.
Diffstat (limited to 'src/core/cpu_manager.h')
-rw-r--r--src/core/cpu_manager.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/core/cpu_manager.h b/src/core/cpu_manager.h
index 17420c9418..5ea149f1fc 100644
--- a/src/core/cpu_manager.h
+++ b/src/core/cpu_manager.h
@@ -83,7 +83,7 @@ private:
void RunThread(std::size_t core);
struct CoreData {
- std::shared_ptr<Common::Fiber> host_context;
+ std::unique_ptr<Common::Fiber> host_context;
std::unique_ptr<Common::Event> enter_barrier;
std::unique_ptr<Common::Event> exit_barrier;
std::atomic<bool> is_running;