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: 734a4c1f810bbec16fe007f31fffa360898955ac
  • Loading branch information
kimishpatel authored and facebook-github-bot committed Oct 28, 2020
1 parent c3fc17b commit cbf90da
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 cbf90da

Please sign in to comment.