Ver Fonte

fix a bug

blueloveTH há 3 anos atrás
pai
commit
efc7da7dc7
1 ficheiros alterados com 1 adições e 1 exclusões
  1. 1 1
      src/memory.h

+ 1 - 1
src/memory.h

@@ -132,7 +132,7 @@ struct SmallArrayPool {
 
     void dealloc(T* p, int n){
         if(n == 0) return;
-        if(n > __Bucket){
+        if(n > __Bucket || buckets[n].size() >= __BucketSize){
             delete[] p;
         }else{
             buckets[n].push_back(p);