Pārlūkot izejas kodu

HPCC-17873 Provide an operator | for roxiemem::RoxieHeapFlags

Signed-off-by: Gavin Halliday <gavin.halliday@lexisnexis.com>
Gavin Halliday 8 gadi atpakaļ
vecāks
revīzija
e839172aec

+ 1 - 1
common/thorhelper/thorstrand.cpp

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

+ 1 - 0
roxie/roxiemem/roxiemem.hpp

@@ -413,6 +413,7 @@ enum RoxieHeapFlags
     //internal flags
     RHForphaned         = 0x80000000,   // heap will no longer be used, can be deleted
 };
+inline RoxieHeapFlags operator | (RoxieHeapFlags l, RoxieHeapFlags r) { return (RoxieHeapFlags)((unsigned)l | (unsigned)r); }
 
 //This interface is here to allow atomic updates to allocations when they are being resized.  There are a few complications:
 //- If a new block is allocated, we just need to update the capacity/pointer atomically

+ 1 - 1
thorlcr/activities/lookupjoin/thlookupjoinslave.cpp

@@ -1400,7 +1400,7 @@ public:
         leftITDL = queryInput(0);
         rightITDL = queryInput(1);
         rightOutputMeta = rightITDL->queryFromActivity()->queryContainer().queryHelper()->queryOutputMeta();
-        rightAllocator.setown(rightThorAllocator->getRowAllocator(rightOutputMeta, container.queryId(), (roxiemem::RoxieHeapFlags)(roxiemem::RHFpacked|roxiemem::RHFunique)));
+        rightAllocator.setown(rightThorAllocator->getRowAllocator(rightOutputMeta, container.queryId(), (roxiemem::RHFpacked|roxiemem::RHFunique)));
 
         allocator.set(queryRowAllocator());
         leftAllocator.set(::queryRowAllocator(leftITDL));

+ 2 - 2
thorlcr/activities/msort/thsortu.cpp

@@ -1680,7 +1680,7 @@ class CMultiCoreJoinHelper: public CMultiCoreJoinHelperBase
             PROGLOG("CMultiCoreJoinHelper::cWorker started");
 
             Owned<IThorRowInterfaces> rowIf = parent->activity.getRowInterfaces();
-            Owned<IEngineRowAllocator> allocator = parent->activity.getRowAllocator(rowIf->queryRowMetaData(), (roxiemem::RoxieHeapFlags)(roxiemem::RHFpacked|roxiemem::RHFunique));
+            Owned<IEngineRowAllocator> allocator = parent->activity.getRowAllocator(rowIf->queryRowMetaData(), (roxiemem::RHFpacked|roxiemem::RHFunique));
 
             IRowWriter *rowWriter = rowStream->queryWriter();
             for (;;)
@@ -1879,7 +1879,7 @@ class CMultiCoreUnorderedJoinHelper: public CMultiCoreJoinHelperBase
         int run()
         {
             Owned<IThorRowInterfaces> rowIf = parent->activity.getRowInterfaces();
-            Owned<IEngineRowAllocator> allocator = parent->activity.getRowAllocator(rowIf->queryRowMetaData(), (roxiemem::RoxieHeapFlags)(roxiemem::RHFpacked|roxiemem::RHFunique));
+            Owned<IEngineRowAllocator> allocator = parent->activity.getRowAllocator(rowIf->queryRowMetaData(), (roxiemem::RHFpacked|roxiemem::RHFunique));
 
             Owned<IRowWriter> rowWriter = parent->multiWriter->getWriter();
             PROGLOG("CMulticoreUnorderedJoinHelper::cWorker started");

+ 1 - 1
thorlcr/activities/project/thprojectslave.cpp

@@ -31,7 +31,7 @@ public:
     {
         helper = static_cast <IHThorProjectArg *> (queryHelper());
         Owned<IRowInterfaces> rowIf = parent.getRowInterfaces();
-        allocator.setown(parent.getRowAllocator(rowIf->queryRowMetaData(), (roxiemem::RoxieHeapFlags)(parent.queryHeapFlags()|roxiemem::RHFpacked|roxiemem::RHFunique)));
+        allocator.setown(parent.getRowAllocator(rowIf->queryRowMetaData(), (parent.queryHeapFlags()|roxiemem::RHFpacked|roxiemem::RHFunique)));
     }
     STRAND_CATCH_NEXTROW()
     {