Explorar el Código

HPCC-19057 Clean up a couple of memory manager names/parameters

Signed-off-by: Gavin Halliday <gavin.halliday@lexisnexis.com>
Gavin Halliday hace 7 años
padre
commit
cd60f6b0bc

+ 1 - 1
common/thorhelper/thorcommon.cpp

@@ -64,7 +64,7 @@ static CClassMeta<AggregateRowBuilder> AggregateRowBuilderMeta;
 void RowAggregator::start(IEngineRowAllocator *_rowAllocator, ICodeContext *ctx, unsigned activityId)
 {
     rowAllocator.set(_rowAllocator);
-    rowBuilderAllocator.setown(ctx->getRowAllocatorEx(&AggregateRowBuilderMeta, activityId, roxiemem::RHFunique|roxiemem::RHFnofragment|roxiemem::RHFdelayrelease));
+    rowBuilderAllocator.setown(ctx->getRowAllocatorEx(&AggregateRowBuilderMeta, activityId, roxiemem::RHFunique|roxiemem::RHFscanning|roxiemem::RHFdelayrelease));
 }
 
 void RowAggregator::reset()

+ 2 - 2
common/thorhelper/thorstrand.cpp

@@ -277,8 +277,8 @@ RowBlockAllocator::RowBlockAllocator(roxiemem::IRowManager & rowManager, size32_
 
     size_t classSize = sizeof(RoxieRowBlock) - RoxieRowBlock::numDummyDynamicRows * sizeof(void *);
     size_t requestedSize = classSize + minRowsPerBlock * sizeof(void*);
-    roxiemem::RoxieHeapFlags heapFlags = roxiemem::RHFunique|roxiemem::RHFnofragment;
-    heap.setown(rowManager.createFixedRowHeap(requestedSize, 0, heapFlags, 0));
+    roxiemem::RoxieHeapFlags heapFlags = roxiemem::RHFunique|roxiemem::RHFscanning;
+    heap.setown(rowManager.createFixedRowHeap(requestedSize, 0, heapFlags));
     rowsPerBlock = (rowManager.getExpectedCapacity(requestedSize, heapFlags) - classSize ) / sizeof(void*);
     assertex(rowsPerBlock >= minRowsPerBlock);
 }

+ 1 - 1
roxie/ccd/ccdmain.cpp

@@ -144,7 +144,7 @@ bool defaultCheckingHeap = false;
 bool defaultDisableLocalOptimizations = false;
 unsigned defaultStrandBlockSize = 512;
 unsigned defaultForceNumStrands = 0;
-unsigned defaultHeapFlags = roxiemem::RHFnofragment;
+unsigned defaultHeapFlags = roxiemem::RHFscanning;
 
 unsigned slaveQueryReleaseDelaySeconds = 60;
 unsigned coresPerQuery = 0;

+ 1 - 1
roxie/ccd/ccdserver.cpp

@@ -7637,7 +7637,7 @@ class CRoxieServerHashDedupActivity : public CRoxieServerActivity
         void onCreate(IRoxieSlaveContext *ctx)
         {
             keyRowAllocator.setown(activity.createRowAllocator(keySize.queryOriginal()));
-            elementRowAllocator.setown(activity.createRowAllocatorEx(&hashDedupElementMeta, roxiemem::RHFunique|roxiemem::RHFnofragment|roxiemem::RHFdelayrelease));
+            elementRowAllocator.setown(activity.createRowAllocatorEx(&hashDedupElementMeta, roxiemem::RHFunique|roxiemem::RHFscanning|roxiemem::RHFdelayrelease));
         }
 
         void reset()

+ 18 - 17
roxie/roxiemem/roxiemem.cpp

@@ -1508,7 +1508,7 @@ public:
 
     void precreateFreeChain()
     {
-        if (heapFlags & RHFnofragment)
+        if (heapFlags & RHFscanning)
             return;
         //The function is to aid testing - it allows the cas code to be tested without a surrounding lock
         //Allocate all possible rows and add them to the free space map.
@@ -1588,7 +1588,7 @@ protected:
 
     inline void inlineReleasePointer(char * ptr)
     {
-        if (heapFlags & RHFnofragment)
+        if (heapFlags & RHFscanning)
         {
             if (heapFlags & RHFdelayrelease)
             {
@@ -1847,7 +1847,7 @@ public:
         while (leaked > 0 && base < limit)
         {
             const char *block = data() + base;
-            if (heapFlags & RHFnofragment)
+            if (heapFlags & RHFscanning)
             {
                 if (((std::atomic_uint *)block)->load(std::memory_order_relaxed) < FREE_ROW_COUNT_MIN)
                 {
@@ -2458,7 +2458,7 @@ public:
                     flags.append("U");
                 if (cur.heapFlags & RHFvariable)
                     flags.append("V");
-                if (cur.heapFlags & RHFnofragment)
+                if (cur.heapFlags & RHFscanning)
                     flags.append("S");
 
                 //Should never be called with numPages == 0, but protect against divide by zero in case of race condition etc.
@@ -3383,7 +3383,7 @@ char * ChunkedHeaplet::allocateSingle(unsigned allocated, bool incCounter, unsig
     char *ret;
     const size32_t size = chunkSize;
 
-    if (heapFlags & RHFnofragment)
+    if (heapFlags & RHFscanning)
     {
         unsigned numAllocs = count.load(std::memory_order_acquire)+allocated-1;
         unsigned curFreeBase = freeBase.load(std::memory_order_relaxed);
@@ -4258,7 +4258,7 @@ public:
             size32_t thisSize = ROUNDEDSIZE(rounded);
             unsigned flags = RHFvariable;
 #ifdef ALWAYS_USE_SCAN_HEAP
-            flags |= RHFnofragment;
+            flags |= RHFscanning;
 #ifdef ALWAYS_DELAY_RELEASE
             flags |= RHFdelayrelease;
 #endif
@@ -4735,15 +4735,16 @@ public:
                     dataBuffs, dataBuffPages, possibleGoers.load(), dataBuff, this);
     }
 
-    virtual IFixedRowHeap * createFixedRowHeap(size32_t fixedSize, unsigned activityId, unsigned roxieHeapFlags, unsigned maxSpillCost)
+    virtual IFixedRowHeap * createFixedRowHeap(size32_t fixedSize, unsigned activityId, unsigned roxieHeapFlags)
     {
 #ifdef ALWAYS_USE_SCAN_HEAP
-        roxieHeapFlags |= RHFnofragment;
+        roxieHeapFlags |= RHFscanning;
 #ifdef ALWAYS_DELAY_RELEASE
         roxieHeapFlags |= RHFdelayrelease;
 #endif
 #endif
-        CRoxieFixedRowHeapBase * rowHeap = doCreateFixedRowHeap(fixedSize, activityId, roxieHeapFlags, maxSpillCost);
+        unsigned defaultSpillCost = SpillAllCost; //i.e. if the allocation must fails then abort the query
+        CRoxieFixedRowHeapBase * rowHeap = doCreateFixedRowHeap(fixedSize, activityId, roxieHeapFlags, defaultSpillCost);
 
         SpinBlock block(fixedSpinLock);
         //The Row heaps are not linked by the row manager so it can determine when they are released.
@@ -4880,7 +4881,7 @@ protected:
         if ((roxieHeapFlags & RHFoldfixed) || (fixedSize > FixedSizeHeaplet::maxHeapSize()))
             return new CRoxieFixedRowHeap(this, activityId, (RoxieHeapFlags)roxieHeapFlags, fixedSize);
 
-        unsigned heapFlags = roxieHeapFlags & (RHFunique|RHFpacked|RHFnofragment|RHFdelayrelease);
+        unsigned heapFlags = roxieHeapFlags & (RHFunique|RHFpacked|RHFscanning|RHFdelayrelease);
         if (heapFlags & RHFpacked)
         {
             CPackedChunkingHeap * heap = createPackedHeap(fixedSize, activityId, heapFlags, maxSpillCost);
@@ -4939,7 +4940,7 @@ protected:
 #ifdef ALWAYS_USE_SCAN_HEAP
         if (!(flags & RHFunique))
 #else
-        if (!(flags & (RHFunique|RHFnofragment)))
+        if (!(flags & (RHFunique|RHFscanning)))
 #endif
         {
             size32_t whichHeap = ROUNDEDHEAP(rounded);
@@ -7790,16 +7791,16 @@ protected:
         testHeapletCas();
         testOldFixedCas();
         testSharedFixedCas("fixed", 0);
-        testSharedFixedCas("fixed scan", RHFnofragment);
+        testSharedFixedCas("fixed scan", RHFscanning);
         //NB: blocked allocators cannot be shared
         testFixedCas("fixed", 0);
         testFixedCas("packed", RHFpacked);
-        testFixedCas("packed scan", RHFpacked|RHFnofragment);
+        testFixedCas("packed scan", RHFpacked|RHFscanning);
         testFixedCas("packed blocked", RHFpacked|RHFblocked);
-        testFixedCas("packed blocked scan", RHFpacked|RHFnofragment|RHFblocked);
-        testFixedCas("packed delayed scan", RHFpacked|RHFnofragment|RHFdelayrelease);
+        testFixedCas("packed blocked scan", RHFpacked|RHFscanning|RHFblocked);
+        testFixedCas("packed delayed scan", RHFpacked|RHFscanning|RHFdelayrelease);
         testFixedCas("packed blocked", RHFpacked|RHFblocked);
-        testFixedCas("packed delayed blocked scan", RHFpacked|RHFnofragment|RHFblocked|RHFdelayrelease);
+        testFixedCas("packed delayed blocked scan", RHFpacked|RHFscanning|RHFblocked|RHFdelayrelease);
         testGeneralCas();
     }
 
@@ -8855,7 +8856,7 @@ protected:
 
     void createRows(IRowManager * rowManager, size_t numRows, ConstPointerArray & target, bool shuffle)
     {
-        Owned<IFixedRowHeap> heap = rowManager->createFixedRowHeap(tuningAllocSize, 0, RHFpacked, 0);
+        Owned<IFixedRowHeap> heap = rowManager->createFixedRowHeap(tuningAllocSize, 0, RHFpacked);
         target.ensure(numTuningRows);
         for (size_t i = 0; i < numRows; i++)
             target.append(heap->allocate());

+ 2 - 2
roxie/roxiemem/roxiemem.hpp

@@ -416,7 +416,7 @@ enum RoxieHeapFlags
     RHFoldfixed         = 0x0008,  // Don't create a special fixed size heap for this
     RHFvariable         = 0x0010,  // only used for tracing
     RHFblocked          = 0x0040,  // allocate blocks of rows
-    RHFnofragment       = 0x0080,  // the allocated records will not be fragmented
+    RHFscanning         = 0x0080,  // scan the heaplet for free items instead of using a free list
     RHFdelayrelease     = 0x0100,
 
     //internal flags
@@ -459,7 +459,7 @@ interface IRowManager : extends IInterface
     virtual void noteDataBuffReleased(DataBuffer *dataBuff) = 0 ;
     virtual void reportLeaks() = 0;
     virtual void checkHeap() = 0;
-    virtual IFixedRowHeap * createFixedRowHeap(size32_t fixedSize, unsigned activityId, unsigned roxieHeapFlags, unsigned maxSpillCost = SpillAllCost) = 0;
+    virtual IFixedRowHeap * createFixedRowHeap(size32_t fixedSize, unsigned activityId, unsigned roxieHeapFlags) = 0;
     virtual IVariableRowHeap * createVariableRowHeap(unsigned activityId, unsigned roxieHeapFlags) = 0;            // should this be passed the initial size?
     virtual void addRowBuffer(IBufferedRowCallback * callback) = 0;
     virtual void removeRowBuffer(IBufferedRowCallback * callback) = 0;

+ 1 - 1
thorlcr/graph/thgraph.hpp

@@ -58,7 +58,7 @@
 
 
 enum ActivityAttributes { ActAttr_Source=1, ActAttr_Sink=2 };
-const static unsigned defaultHeapFlags = roxiemem::RHFnofragment;
+const static unsigned defaultHeapFlags = roxiemem::RHFscanning;
 
 #define INVALID_UNIQ_ID -1;
 typedef activity_id unique_id;