Skip to content

Commit

Permalink
fix: Use MemoryManager::testInstance to check the MemoryManager initi…
Browse files Browse the repository at this point in the history
…alization (#11926)

Summary:
Use `MemoryManager::testInstance` to check whether the MemoryManager
is initialized in `TraceReplayRunner.cpp` instead of `memory::memoryManager()`
as it uses `MemoryManager::instance`, which would throw if the MemoryManager
instance is null.

Pull Request resolved: #11926

Reviewed By: xiaoxmeng

Differential Revision: D67571450

Pulled By: tanjialiang

fbshipit-source-id: 1d0a91b27b124ff90ce3bbe38d7fe5d30319f5e1
  • Loading branch information
duanmeng authored and facebook-github-bot committed Dec 25, 2024
1 parent 8ebd3a8 commit b0a8908
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion velox/tool/trace/TraceReplayRunner.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@ void TraceReplayRunner::init() {
VELOX_USER_CHECK(!FLAGS_query_id.empty(), "--query_id must be provided");
VELOX_USER_CHECK(!FLAGS_node_id.empty(), "--node_id must be provided");

if (memory::memoryManager() == nullptr) {
if (!memory::MemoryManager::testInstance()) {
memory::initializeMemoryManager({});
}
filesystems::registerLocalFileSystem();
Expand Down

0 comments on commit b0a8908

Please sign in to comment.