Skip to content

Commit

Permalink
Fix CPUCaching allocator guard bug (#46922)
Browse files Browse the repository at this point in the history
Summary:
Pull Request resolved: #46922

Earlier bug wrongly captures the previous value to be saved.

Test Plan: cpu_caching_allocator_test

Reviewed By: dreiss

Differential Revision: D24566514

fbshipit-source-id: 8b4ee6ed7a3c6a0c6b6a4aa1e50ce14e94d2eee6
  • Loading branch information
kimishpatel authored and facebook-github-bot committed Oct 27, 2020
1 parent bbe5bfa commit cfc8269
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion c10/mobile/CPUCachingAllocator.cpp
Expand Up @@ -95,8 +95,8 @@ CPUCachingAllocator* GetThreadLocalCachingAllocator() {

WithCPUCachingAllocatorGuard::WithCPUCachingAllocatorGuard(
CPUCachingAllocator* allocator) {
caching_allocator_ptr = allocator;
prev_caching_allocator_ptr_ = GetThreadLocalCachingAllocator();
caching_allocator_ptr = allocator;
}

WithCPUCachingAllocatorGuard::~WithCPUCachingAllocatorGuard() {
Expand Down

0 comments on commit cfc8269

Please sign in to comment.