Browse Source

[MSLITE] fix bug of memory leakage.

pull/15240/head
wang_shaocong 4 years ago
parent
commit
87cf8ef747
1 changed files with 1 additions and 1 deletions
  1. +1
    -1
      mindspore/lite/src/runtime/allocator.cc

+ 1
- 1
mindspore/lite/src/runtime/allocator.cc View File

@@ -55,7 +55,7 @@ void *DefaultAllocator::Malloc(size_t size) {
}
Lock();
auto iter = freeList_.lower_bound(size);
if (iter != freeList_.end() && (iter->second->size >= size) && (iter->second->size < (size << shiftFactor_))) {
if (iter != freeList_.end() && (iter->second->size >= size) && (iter->second->size <= (size << shiftFactor_))) {
auto membuf = iter->second;
freeList_.erase(iter);
allocatedList_[membuf->buf] = membuf;


Loading…
Cancel
Save