14 #ifndef __UT_PageArray__ 
   15 #define __UT_PageArray__ 
  228 template<
typename DATA_T,ex
int TSIZE=1,
bool TABLEHARDENED=false,
bool PAGESHARDENED=false,ex
int THEPAGEBITS=10,
typename IDX_T=ex
int>
 
  241     template<
typename DATA_T2,ex
int TSIZE2,
bool TABLEHARDENED2,
bool PAGESHARDENED2,ex
int THEPAGEBITS2,
typename IDX_T2>
 
  260         myImpl.getPages() = 
nullptr;
 
  271         myImpl.getPages() = 
nullptr;
 
  272         myImpl.setTupleSize(tuplesize);
 
  282         myImpl.getPages() = 
nullptr;
 
  283         myImpl.setStorage(storage);
 
  295         myImpl.getPages() = 
nullptr;
 
  296         myImpl.setStorage(storage);
 
  297         myImpl.setTupleSize(tuplesize);
 
  306         myImpl.getPages() = 
nullptr;
 
  310     template<
typename SRC_DATA_T,ex
int SRC_TSIZE,
bool SRC_TABLEHARDENED,
bool SRC_PAGESHARDENED>
 
  313         myImpl.getPages() = 
nullptr;
 
  326         if (myImpl.getPages())
 
  327             myImpl.getPages()->setSize(IDX_T(0));
 
  332         if (!myImpl.getPages())
 
  335         const exint tuplesize = myImpl.getTupleSize();
 
  338         if constexpr (!SYSisSame<DATA_T,void>())
 
  339             myImpl.getPages()->decRef(tuplesize);
 
  346                 UT_ASSERT_MSG_P(0, 
"Can't have a non-numeric type with a void DATA_T.");
 
  349                 castType<int8>().myImpl.getPages()->decRef(tuplesize);     
return;
 
  351                 castType<uint8>().myImpl.getPages()->decRef(tuplesize);    
return;
 
  353                 castType<int16>().myImpl.getPages()->decRef(tuplesize);    
return;
 
  355                 castType<int32>().myImpl.getPages()->decRef(tuplesize);    
return;
 
  357                 castType<int64>().myImpl.getPages()->decRef(tuplesize);    
return;
 
  359                 castType<fpreal16>().myImpl.getPages()->decRef(tuplesize); 
return;
 
  361                 castType<fpreal32>().myImpl.getPages()->decRef(tuplesize); 
return;
 
  363                 castType<fpreal64>().myImpl.getPages()->decRef(tuplesize); 
return;
 
  366         myImpl.getPages() = 
nullptr;
 
  380     template<
typename SRC_DATA_T,ex
int SRC_TSIZE,
bool SRC_TABLEHARDENED,
bool SRC_PAGESHARDENED>
 
  390     template<
typename SRC_DATA_T,ex
int SRC_TSIZE,
bool SRC_TABLEHARDENED,
bool SRC_PAGESHARDENED>
 
  396         if ((
void *)
this == (
const void *)&that)
 
  401         if (!TABLEHARDENED &&
 
  402                 myImpl.getStorage() == that.myImpl.getStorage() &&
 
  403                 myImpl.getTupleSize() == that.myImpl.getTupleSize() &&
 
  404                 (
void *)myImpl.getPages() == (
const void *)that.myImpl.getPages())
 
  409         if constexpr (SYSisSame<DATA_T,void>())
 
  410             myImpl.setStorage(that.myImpl.getStorage());
 
  411         if constexpr (TSIZE == -1)
 
  412             myImpl.setTupleSize(that.myImpl.getTupleSize());
 
  415         if constexpr ((SYSisSame<DATA_T,void>() || SYSisSame<DATA_T,SRC_DATA_T>()) && (TSIZE == -1 || TSIZE == SRC_TSIZE))
 
  417             PageTable *pages = 
reinterpret_cast<PageTable *
>(
SYSconst_cast(that.myImpl.getPages()));
 
  418             myImpl.getPages() = pages;
 
  422             if constexpr (TABLEHARDENED || PAGESHARDENED || SRC_TABLEHARDENED || SRC_PAGESHARDENED)
 
  425                 if (PAGESHARDENED || SRC_PAGESHARDENED)
 
  429                         ->template hardenAllPages<false>();
 
  439             moveRange(that, IDX_T(0), IDX_T(0), size);
 
  450         UT_ASSERT_P(component >= 0 && component < myImpl.getTupleSize());
 
  453         const PageTableEntry *page = myImpl.getPages()->getPPage(pagenum);
 
  457         bool isconst = !PAGESHARDENED && page->isConstant();
 
  464                 return page->getFirstPtr()[TSIZE*pageoff + component];
 
  473                 return page->getFirstPtr()[myImpl.getTupleSize()*pageoff + component];
 
  475             return getConstant(page, component, myImpl.getTupleSize());
 
  486     template<
typename DEST_DATA_T=DATA_T>
 
  491             return UTconvertStorage<DEST_DATA_T>((*this)(i,component));
 
  493             return getUnknownType<DEST_DATA_T>(i,component);
 
  496     template<
typename DEST_DATA_T=NotVo
idType,ex
int DEST_TSIZE=theSafeTupleSize>
 
  499         if constexpr (SYSisSame<DATA_T,void>())
 
  500             return getVectorUnknownType<DEST_DATA_T,DEST_TSIZE>(i);
 
  501         else if constexpr (!SYSisSame<DEST_DATA_T,DATA_T>())
 
  502             return convertVectorStorage<DEST_DATA_T>(getVector<NotVoidType,DEST_TSIZE>(i));
 
  504         if constexpr (TSIZE==-1)
 
  505             return getVectorUnknownSize<DEST_DATA_T,DEST_TSIZE>(i);
 
  506         else if constexpr (TSIZE!=DEST_TSIZE)
 
  507             return getVectorMismatchedSize<DEST_DATA_T,DEST_TSIZE>(i);
 
  518         const PageTableEntry *page = myImpl.getPages()->getPPage(pagenum);
 
  522         bool isconst = !PAGESHARDENED && page->isConstant();
 
  549         UT_ASSERT_P(component >= 0 && component < myImpl.getTupleSize());
 
  556         PageTable *pages = myImpl.getPages();
 
  557         PageTableEntry *page = pages->getPPage(pagenum);
 
  561             if (page->isConstant())
 
  568             else if (page->isShared())
 
  578                 + pageoff*((TSIZE >= 1) ? TSIZE : myImpl.getTupleSize())
 
  585     template<
typename SRC_DATA_T>
 
  591     template<
typename SRC_DATA_T>
 
  601     template<
typename SRC_DATA_T>
 
  604         op<0>(i, component, 
v);
 
  606     template<
typename SRC_DATA_T>
 
  609         op<1>(i, component, 
v);
 
  611     template<
int OP,
typename SRC_DATA_T>
 
  616         UT_ASSERT_MSG_P(OP == 0 || OP == 1, 
"Only OP 0 (set) and 1 (add) are defined!");
 
  618         if constexpr (SYSisSame<DATA_T,void>())
 
  620             opUnknownType<OP>(i, component, 
v);
 
  634         PageTable *pages = myImpl.getPages();
 
  635         PageTableEntry *page = pages->getPPage(pagenum);
 
  637         if constexpr (!PAGESHARDENED)
 
  639             if (page->isConstant())
 
  651                         if (
getConstant(page, component, myImpl.getTupleSize()) == vt)
 
  660             else if (page->isShared())
 
  666                             + pageoff*((TSIZE >= 1) ? TSIZE : myImpl.getTupleSize())
 
  679                 + pageoff*((TSIZE >= 1) ? TSIZE : myImpl.getTupleSize())
 
  692     template<
typename TS>
 
  698     template<
typename TS>
 
  708     template<
int OP,
typename SRC_DATA_T,ex
int SRC_TSIZE>
 
  712         UT_ASSERT_MSG_P(OP == 0 || OP == 1, 
"Only OP 0 (set) and 1 (add) are defined!");
 
  714         if constexpr (SYSisSame<DATA_T,void>())
 
  716             opVectorUnknownType<OP>(i, 
v);
 
  720         const exint tuplesize = myImpl.getTupleSize();
 
  721         if constexpr (TSIZE == -1)
 
  723             if (tuplesize == SRC_TSIZE)
 
  725                 castTupleSize<SRC_TSIZE>().
template opVector<OP>(i, v);
 
  730         const exint mintuplesize = 
SYSmin(tuplesize, SRC_TSIZE);
 
  734         constexpr 
bool TYPE_MATCH = SYSisSame<SRC_DATA_T,NotVoidType>();
 
  737             converted_v = convertVectorStorage<NotVoidType>(
v);
 
  746         PageTable *pages = myImpl.getPages();
 
  747         PageTableEntry *page = pages->getPPage(pagenum);
 
  749         if constexpr (!PAGESHARDENED)
 
  751             if (page->isConstant())
 
  754                 if constexpr (OP == 0)
 
  758                         data = page->getInlinePtr(tuplesize);
 
  760                         data = page->getMaskedPtr();
 
  763                         if constexpr (TYPE_MATCH)
 
  770                             if (
isEqual(data, converted_v.data(), mintuplesize))
 
  776                         if constexpr (TYPE_MATCH)
 
  783                             if (
isZero(converted_v.data(), mintuplesize))
 
  793             else if (page->isShared())
 
  796                 if constexpr (OP == 0)
 
  799                             + pageoff*((TSIZE >= 0) ? TSIZE : tuplesize);
 
  800                     if constexpr (TYPE_MATCH)
 
  807                         if (
isEqual(data, converted_v.data(), mintuplesize))
 
  811                 if constexpr (TSIZE >= 1)
 
  818         NotVoidType *
data = page->getFirstPtr() + pageoff*((TSIZE >= 0) ? TSIZE : tuplesize);
 
  819         for (
exint component = 0; component < mintuplesize; ++component)
 
  821             if constexpr (OP == 0)
 
  823                 if constexpr (TYPE_MATCH)
 
  824                     data[component] = v[component];
 
  826                     data[component] = converted_v[component];
 
  828             else if constexpr (OP == 1)
 
  830                 if constexpr (TYPE_MATCH)
 
  831                     data[component] += v[component];
 
  833                     data[component] += converted_v[component];
 
  844         const PageTable *pages = myImpl.getPages();
 
  847         return pages->size();
 
  852         const PageTable *pages = myImpl.getPages();
 
  855         return pages->capacity();
 
  873         if (capacity <= IDX_T(2))
 
  875         return IDX_T(SYSmakePow2(
exint(capacity)));
 
  884         if (newcapacity < 
size())
 
  908         PageTable *pages = myImpl.getPages();
 
  911             pages->setSize(newsize);
 
  954     template<
typename SRC_T>
 
  987     void moveRange(IDX_T srcstart, IDX_T deststart, IDX_T nelements);
 
  992     template<
typename SRC_DATA_T,ex
int SRC_TSIZE,
bool SRC_TABLEHARDENED,
bool SRC_PAGESHARDENED>
 
  998     void swapRange(IDX_T astart, IDX_T bstart, IDX_T nelements);
 
 1016         PageTable *pages = myImpl.getPages();
 
 1017         PageTableEntry *destpage = pages->getPPage(destpagenum);
 
 1018         const PageTableEntry *srcpage = pages->getPPage(srcpagenum);
 
 1020         const int8 *srcdata;
 
 1021         if (srcpage->isConstant())
 
 1023             if (bytesize < 
sizeof(PageTableEntry))
 
 1026                 if (*srcpage == *destpage)
 
 1029                 srcdata = ((
const int8 *)(srcpage+1)) - bytesize;
 
 1031             else if (srcpage->getUnmaskedPtrVoid() == destpage->getUnmaskedPtrVoid())
 
 1039                 srcdata = (
const int8 *)srcpage->getMaskedPtrVoid();
 
 1044             srcdata = ((
const int8*)srcpage->getFirstPtrVoid()) + 
pageOff(src)*bytesize;
 
 1048         if (destpage->isConstant())
 
 1050             if (bytesize < 
sizeof(PageTableEntry))
 
 1051                 destdata = ((
int8 *)(destpage+1)) - bytesize;
 
 1054                 void *destmasked = destpage->getMaskedPtrVoid();
 
 1055                 if (destmasked == 
nullptr)
 
 1057                     if (
isZero(srcdata, bytesize))
 
 1062                     destdata = (
int8*)destmasked;
 
 1064             if (destdata != 
nullptr && 
isEqual(srcdata, destdata, bytesize))
 
 1067             if constexpr (!SYSisSame<DATA_T,void>())
 
 1076                         auto &
a = castType<int8>();
 
 1077                         auto a_pages = 
a.myImpl.getPages();
 
 1078                         auto a_destpage = a_pages->getPPage(destpagenum);
 
 1085                         auto &
a = castType<int16>();
 
 1086                         auto a_pages = 
a.myImpl.getPages();
 
 1087                         auto a_destpage = a_pages->getPPage(destpagenum);
 
 1094                         auto &
a = castType<int32>();
 
 1095                         auto a_pages = 
a.myImpl.getPages();
 
 1096                         auto a_destpage = a_pages->getPPage(destpagenum);
 
 1103                         auto &
a = castType<int64>();
 
 1104                         auto a_pages = 
a.myImpl.getPages();
 
 1105                         auto a_destpage = a_pages->getPPage(destpagenum);
 
 1110                         UT_ASSERT_MSG(0, 
"Storage must be valid if DATA_T is void.");
 
 1115         else if (!PAGESHARDENED && destpage->isShared())
 
 1117             destdata = ((
int8*)destpage->getFirstPtrVoid()) + 
pageOff(dest)*bytesize;
 
 1120                 if (
isEqual(srcdata, destdata, bytesize))
 
 1125                 if (
isZero(destdata, bytesize))
 
 1129             if constexpr (!SYSisSame<DATA_T,void>())
 
 1138                         auto &
a = castType<int8>();
 
 1139                         auto a_pages = 
a.myImpl.getPages();
 
 1140                         auto a_destpage = a_pages->getPPage(destpagenum);
 
 1147                         auto &
a = castType<int16>();
 
 1148                         auto a_pages = 
a.myImpl.getPages();
 
 1149                         auto a_destpage = a_pages->getPPage(destpagenum);
 
 1156                         auto &
a = castType<int32>();
 
 1157                         auto a_pages = 
a.myImpl.getPages();
 
 1158                         auto a_destpage = a_pages->getPPage(destpagenum);
 
 1165                         auto &
a = castType<int64>();
 
 1166                         auto a_pages = 
a.myImpl.getPages();
 
 1167                         auto a_destpage = a_pages->getPPage(destpagenum);
 
 1172                         UT_ASSERT_MSG(0, 
"Storage must be valid if DATA_T is void.");
 
 1177         destdata = ((
int8*)destpage->getFirstPtrVoid()) + 
pageOff(dest)*bytesize;
 
 1179         for (
const int8 *srcdataend = srcdata+bytesize; srcdata != srcdataend; ++srcdata, ++destdata)
 
 1180             *destdata = *srcdata;
 
 1185     template<
typename T>
 
 1195     template<
typename T>
 
 1205     template<
typename DEST_DATA_T,ex
int DEST_TSIZE>
 
 1210     template<
typename SRC_DATA_T,ex
int SRC_TSIZE>
 
 1236         UT_ASSERT_P(!TABLEHARDENED || !myImpl.getPages() || !myImpl.getPages()->isShared());
 
 1238         return TABLEHARDENED || !myImpl.getPages() || !myImpl.getPages()->isShared();
 
 1259     template <
bool including_capacity=false>
 
 1263         PageTable *pages = myImpl.getPages();
 
 1264         if (PAGESHARDENED || (pages == 
nullptr))
 
 1270             end = including_capacity ? pages->capacity() : pages->size();
 
 1275         if constexpr (!SYSisSame<DATA_T,void>())
 
 1277             if constexpr (TSIZE >= 1)
 
 1280                 pages->hardenAllPages(
start, 
end, myImpl.getTupleSize());
 
 1286             hard.hardenAllPagesUnknownType(
start, 
end);
 
 1292     template <
bool including_capacity=false>
 
 1296         PageTable *pages = myImpl.getPages();
 
 1297         if (PAGESHARDENED || (pages == 
nullptr))
 
 1303             end = including_capacity ? pages->capacity() : pages->size();
 
 1308         if constexpr (!SYSisSame<DATA_T,void>())
 
 1310             if constexpr (TSIZE >= 1)
 
 1311                 pages->tryCompressAllPages(
start, 
end);
 
 1313                 pages->tryCompressAllPages(
start, 
end, myImpl.getTupleSize());
 
 1319             hard.tryCompressAllPagesUnknownType(
start, 
end);
 
 1326     template<
typename DEST_DATA_T>
 
 1334     template<
typename DEST_DATA_T>
 
 1347     template<ex
int DEST_TSIZE>
 
 1355     template<ex
int DEST_TSIZE>
 
 1367         return myImpl.getTupleSize();
 
 1371         return myImpl.getStorage();
 
 1379         return myImpl.getPages()->getPPage(pagenum)->isConstant();
 
 1386         if (myImpl.getPages() == 
nullptr)
 
 1389         const PageTable *pages = myImpl.getPages();
 
 1392         for (
UT_PageNum pagenum = 0; pagenum < npages; pagenum++)
 
 1394             const PageTableEntry *page = pages->getPPage(pagenum);
 
 1395             if (!page->isConstantAndZeroSafe())
 
 1411         PageTableEntry *page = myImpl.getPages()->getPPage(pagenum);
 
 1420     template<
typename SRC_DATA_T>
 
 1423         if constexpr (SYSisSame<DATA_T,void>())
 
 1431         if constexpr (!SYSisSame<DATA_T,SRC_DATA_T>())
 
 1435                 new_val[i] = UTconvertStorage<NotVoidType>(val[i]);
 
 1448         PageTableEntry *page = myImpl.getPages()->getPPage(pagenum);
 
 1455     template<
typename SRC_DATA_T>
 
 1458         if constexpr (SYSisSame<DATA_T,void>())
 
 1466         if constexpr (!SYSisSame<DATA_T,SRC_DATA_T>())
 
 1478         PageTableEntry *page = myImpl.getPages()->getPPage(pagenum);
 
 1491         if constexpr (PAGESHARDENED)
 
 1495             const PageTableEntry *page = myImpl.getPages()->getPPage(pagenum);
 
 1496             return !page->isConstant() && !page->isShared();
 
 1510         PageTable *pages = myImpl.getPages();
 
 1511         PageTableEntry *page = pages->getPPage(pagenum);
 
 1513         if constexpr (PAGESHARDENED)
 
 1514             return page->getFirstPtr();
 
 1516         if (page->isConstant())
 
 1518         else if (page->isShared())
 
 1520         return page->getFirstPtr();
 
 1530         PageTable *pages = myImpl.getPages();
 
 1531         PageTableEntry *page = pages->getPPage(pagenum);
 
 1533         if constexpr (PAGESHARDENED)
 
 1534             return page->getFirstPtr();
 
 1536         if (page->isConstant())
 
 1538         else if (page->isShared())
 
 1540         return page->getFirstPtr();
 
 1556         PageTable *pages = myImpl.getPages();
 
 1557         PageTableEntry *page = pages->getPPage(pagenum);
 
 1559         UT_ASSERT_P(!PAGESHARDENED && page->isConstant());
 
 1564         const exint tuplesize = (TSIZE >= 0) ? TSIZE : myImpl.getTupleSize();
 
 1566             return page->getInlinePtr(tuplesize);
 
 1569         if (!page->isShared())
 
 1572         PageTableEntry newpage;
 
 1576         newpage.setConstantBit();
 
 1588         PageTable *pages = myImpl.getPages();
 
 1589         if (PAGESHARDENED || (pages == 
nullptr))
 
 1597         if constexpr (!SYSisSame<DATA_T,void>())
 
 1599             if constexpr (TSIZE >= 1)
 
 1600                 pages->tryCompressPage(pagenum);
 
 1602                 pages->tryCompressPage(pagenum, myImpl.getTupleSize());
 
 1608             hard.tryCompressPageUnknownType(pagenum);
 
 1623         const PageTableEntry *page = myImpl.getPages()->getPPage(pagenum);
 
 1624         if (!page->isConstant())
 
 1625             return page->getFirstPtr();
 
 1626         else if constexpr (TSIZE >= 1)
 
 1645         PageTableEntry *page = myImpl.getPages()->getPPage(pagenum);
 
 1646         if (!page->isConstant())
 
 1647             return page->getFirstPtr();
 
 1648         else if constexpr (TSIZE >= 1)
 
 1667         PageTable *
table = myImpl.getPages();
 
 1671         bool decremented = table->decRefIffShared();
 
 1673             myImpl.getPages() = 
nullptr;
 
 1697         PageTableEntry *page = myImpl.getPages()->getPPage(pagenum);
 
 1698         if (page->isConstant())
 
 1700             if (
sizeof(
NotVoidType)*TSIZE < 
sizeof(PageTableEntry))
 
 1703         bool decremented = page->decRefIffShared();
 
 1720         const PageTableEntry *page = myImpl.getPages()->getPPage(pagenum);
 
 1724         bool isconst = !PAGESHARDENED && page->isConstant();
 
 1730             const void *
first = page->getFirstPtrVoid();
 
 1734                     UT_ASSERT_MSG_P(0, 
"getGuaranteedInt() only supports int16, int32, and int64.");
 
 1746         if (!page->isConstantZero())
 
 1755             const void *
v = page->getMaskedPtrVoid();
 
 1761             return *(
const int64 *)v;
 
 1769                 return *page->template castType<int64>()->getInlinePtr(1);
 
 1773                 return (
int64)*page->template castType<int32>()->getInlinePtr(1);
 
 1775             return (
int64)*page->template castType<int16>()->getInlinePtr(1);
 
 1784     template<
typename DEST_DATA_T=DATA_T>
 
 1794         const PageTableEntry *page = myImpl.getPages()->getPPage(pagenum);
 
 1798         bool isconst = !PAGESHARDENED && page->isConstant();
 
 1804             const void *
first = page->getFirstPtrVoid();
 
 1809                 i = TSIZE*pageoff + component;
 
 1811                 i = myImpl.getTupleSize()*pageoff + component;
 
 1815                     UT_ASSERT_MSG_P(0, 
"Can't read a non-numeric type with a cast to a different type.");
 
 1816                     return DEST_DATA_T();
 
 1818                     return (DEST_DATA_T)((
int8*)first)[i];
 
 1820                     return (DEST_DATA_T)((
uint8*)first)[i];
 
 1822                     return (DEST_DATA_T)((
int16*)first)[i];
 
 1824                     return (DEST_DATA_T)((
int32*)first)[i];
 
 1826                     return (DEST_DATA_T)((
int64*)first)[i];
 
 1828                     return (DEST_DATA_T)((
fpreal16*)first)[i];
 
 1830                     return (DEST_DATA_T)((
fpreal32*)first)[i];
 
 1832                     return (DEST_DATA_T)((
fpreal64*)first)[i];
 
 1835             return DEST_DATA_T();
 
 1841                 UT_ASSERT_MSG_P(0, 
"Can't read a non-numeric type with a cast to a different type.");
 
 1842                 return DEST_DATA_T();
 
 1844                 return (DEST_DATA_T)castType<int8>().
getConstant(page->template castType<int8>(), component, (TSIZE >= 1 ? TSIZE : myImpl.getTupleSize()));
 
 1846                 return (DEST_DATA_T)castType<uint8>().
getConstant(page->template castType<uint8>(), component, (TSIZE >= 1 ? TSIZE : myImpl.getTupleSize()));
 
 1848                 return (DEST_DATA_T)castType<int16>().
getConstant(page->template castType<int16>(), component, (TSIZE >= 1 ? TSIZE : myImpl.getTupleSize()));
 
 1850                 return (DEST_DATA_T)castType<int32>().
getConstant(page->template castType<int32>(), component, (TSIZE >= 1 ? TSIZE : myImpl.getTupleSize()));
 
 1852                 return (DEST_DATA_T)castType<int64>().
getConstant(page->template castType<int64>(), component, (TSIZE >= 1 ? TSIZE : myImpl.getTupleSize()));
 
 1854                 return (DEST_DATA_T)castType<fpreal16>().
getConstant(page->template castType<fpreal16>(), component, (TSIZE >= 1 ? TSIZE : myImpl.getTupleSize()));
 
 1856                 return (DEST_DATA_T)castType<fpreal32>().
getConstant(page->template castType<fpreal32>(), component, (TSIZE >= 1 ? TSIZE : myImpl.getTupleSize()));
 
 1858                 return (DEST_DATA_T)castType<fpreal64>().
getConstant(page->template castType<fpreal64>(), component, (TSIZE >= 1 ? TSIZE : myImpl.getTupleSize()));
 
 1860         return DEST_DATA_T();
 
 1863     template<
int OP,
typename SRC_DATA_T>
 
 1871                 UT_ASSERT_MSG_P(0, 
"Can't write a non-numeric type with opUnknownType.");
 
 1874                 castType<int8    >().
template op<OP>(i,component, UTconvertStorage<int8>(v)); 
return;
 
 1876                 castType<uint8   >().
template op<OP>(i,component, UTconvertStorage<uint8>(v)); 
return;
 
 1878                 castType<int16   >().
template op<OP>(i,component, UTconvertStorage<int16>(v)); 
return;
 
 1880                 castType<int32   >().
template op<OP>(i,component, UTconvertStorage<int32>(v)); 
return;
 
 1882                 castType<int64   >().
template op<OP>(i,component, UTconvertStorage<int64>(v)); 
return;
 
 1884                 castType<fpreal16>().
template op<OP>(i,component, (
fpreal16)
v); 
return;
 
 1886                 castType<fpreal32>().
template op<OP>(i,component, (
fpreal32)
v); 
return;
 
 1888                 castType<fpreal64>().
template op<OP>(i,component, (
fpreal64)
v); 
return;
 
 1892     template<
int OP,
typename SRC_DATA_T,ex
int SRC_TSIZE>
 
 1900                 UT_ASSERT_MSG_P(0, 
"Can't write a non-numeric type with opVectorUnknownType.");
 
 1903                 castType<int8    >().
template opVector<OP>(i,v); 
return;
 
 1905                 castType<uint8   >().
template opVector<OP>(i,v); 
return;
 
 1907                 castType<int16   >().
template opVector<OP>(i,v); 
return;
 
 1909                 castType<int32   >().
template opVector<OP>(i,v); 
return;
 
 1911                 castType<int64   >().
template opVector<OP>(i,v); 
return;
 
 1913                 castType<fpreal16>().
template opVector<OP>(i,v); 
return;
 
 1915                 castType<fpreal32>().
template opVector<OP>(i,v); 
return;
 
 1917                 castType<fpreal64>().
template opVector<OP>(i,v); 
return;
 
 1921     template<
typename DEST_DATA_T,ex
int DEST_TSIZE>
 
 1930             return castType<DEST_DATA_T>().
template getVector<DEST_DATA_T,DEST_TSIZE>(i);
 
 1934             return castType<typename UT_StorageNum<DEST_DATA_T>::SecondGuess>().
template getVector<DEST_DATA_T,DEST_TSIZE>(i);
 
 1939                 UT_ASSERT_MSG_P(0, 
"Can't read a non-numeric type with getVectorUnknownType.");
 
 1942                 return castType<int8    >().
template getVector<DEST_DATA_T,DEST_TSIZE>(i);
 
 1944                 return castType<uint8   >().
template getVector<DEST_DATA_T,DEST_TSIZE>(i);
 
 1946                 return castType<int16   >().
template getVector<DEST_DATA_T,DEST_TSIZE>(i);
 
 1948                 return castType<int32   >().
template getVector<DEST_DATA_T,DEST_TSIZE>(i);
 
 1950                 return castType<int64   >().
template getVector<DEST_DATA_T,DEST_TSIZE>(i);
 
 1952                 return castType<fpreal16>().
template getVector<DEST_DATA_T,DEST_TSIZE>(i);
 
 1954                 return castType<fpreal32>().
template getVector<DEST_DATA_T,DEST_TSIZE>(i);
 
 1956                 return castType<fpreal64>().
template getVector<DEST_DATA_T,DEST_TSIZE>(i);
 
 1961     template<
typename DEST_DATA_T,ex
int DEST_TSIZE>
 
 1970         if (tuplesize == DEST_TSIZE)
 
 1971             return castTupleSize<DEST_TSIZE>().
template getVector<DEST_DATA_T,DEST_TSIZE>(i);
 
 1975             return castTupleSize<1>().
template getVectorMismatchedSize<DEST_DATA_T,DEST_TSIZE>(i);
 
 1977             return castTupleSize<2>().
template getVectorMismatchedSize<DEST_DATA_T,DEST_TSIZE>(i);
 
 1979             return castTupleSize<3>().
template getVectorMismatchedSize<DEST_DATA_T,DEST_TSIZE>(i);
 
 1981             return castTupleSize<4>().
template getVectorMismatchedSize<DEST_DATA_T,DEST_TSIZE>(i);
 
 1985         const exint minsize = 
SYSmin(tuplesize,DEST_TSIZE);
 
 1986         for (
exint component = 0; component < minsize; ++component)
 
 1987             v[component] = get<DEST_DATA_T>(i, component);
 
 1991     template<
typename DEST_DATA_T,ex
int DEST_TSIZE>
 
 2000         const PageTableEntry *page = myImpl.getPages()->getPPage(pagenum);
 
 2004         bool isconst = !PAGESHARDENED && page->isConstant();
 
 2019         if (DEST_TSIZE < TSIZE)
 
 2023         for (
exint component = 0; component < TSIZE; ++component)
 
 2024             dsttuple[component] = srctuple[component];
 
 2025         for (
exint component = TSIZE; component < DEST_TSIZE; ++component)
 
 2026             dsttuple[component] = DEST_DATA_T(0);
 
 2036                 UT_ASSERT_MSG_P(0, 
"Can't have a non-numeric type with a void DATA_T.");
 
 2039                 castType<int8>().
template hardenAllPages<false>(start, end);     
return;
 
 2041                 castType<uint8>().
template hardenAllPages<false>(start, end);    
return;
 
 2043                 castType<int16>().
template hardenAllPages<false>(start, end);    
return;
 
 2045                 castType<int32>().
template hardenAllPages<false>(start, end);    
return;
 
 2047                 castType<int64>().
template hardenAllPages<false>(start, end);    
return;
 
 2049                 castType<fpreal16>().
template hardenAllPages<false>(start, end); 
return;
 
 2051                 castType<fpreal32>().
template hardenAllPages<false>(start, end); 
return;
 
 2053                 castType<fpreal64>().
template hardenAllPages<false>(start, end); 
return;
 
 2065                 UT_ASSERT_MSG_P(0, 
"Can't have a non-numeric type with a void DATA_T.");
 
 2068                 castType<int8>().
template tryCompressAllPages<false>(start, end);     
return;
 
 2070                 castType<uint8>().
template tryCompressAllPages<false>(start, end);    
return;
 
 2072                 castType<int16>().
template tryCompressAllPages<false>(start, end);    
return;
 
 2074                 castType<int32>().
template tryCompressAllPages<false>(start, end);    
return;
 
 2076                 castType<int64>().
template tryCompressAllPages<false>(start, end);    
return;
 
 2078                 castType<fpreal16>().
template tryCompressAllPages<false>(start, end); 
return;
 
 2080                 castType<fpreal32>().
template tryCompressAllPages<false>(start, end); 
return;
 
 2082                 castType<fpreal64>().
template tryCompressAllPages<false>(start, end); 
return;
 
 2094             UT_ASSERT_MSG_P(0, 
"Can't have a non-numeric type with a void DATA_T.");
 
 2116     template<
typename SRC_DATA_T>
 
 2124                 UT_ASSERT_MSG_P(0, 
"Can't have a non-numeric type with a void DATA_T.");
 
 2146     template<
typename SRC_DATA_T>
 
 2154                 UT_ASSERT_MSG_P(0, 
"Can't have a non-numeric type with a void DATA_T.");
 
 2176     template<
typename SRC_DATA_T>
 
 2186         const exint tuplesize = myImpl.getTupleSize();
 
 2187         dest_values.setSize(tuplesize);
 
 2189         for (
exint i = 0; i < tuplesize; ++i)
 
 2190             dest_values(i) = UTconvertStorage<NotVoidType>(values[i]);
 
 2218                 && (myPRefCount == 
nullptr);
 
 2256             myPRefCount->
add(1);
 
 2263             int64 new_count = myPRefCount->
add(-1);
 
 2270                 printf(
"Free page        %d pages total\n", 
int(thePageTablePageCount.add(-1)));
 
 2291             printf(
"Alloc page        %d pages total\n", 
int(thePageTablePageCount.add(1)));
 
 2298             UT_ASSERT_P(sizetocopy >= 0 && sizetocopy <= newpagecapacity);
 
 2311                 newpage.
alloc(newpagecapacity, tuplesize);
 
 2316                 sizetocopy *= tuplesize;
 
 2319                     *newdata = *olddata;
 
 2325                 myData = newpage.myData;
 
 2326                 myPRefCount = newpage.myPRefCount;
 
 2473             myPRefCount = 
nullptr;
 
 2487             tuplesize = (TSIZE >= 0 ? TSIZE : tuplesize);
 
 2491             for (
const NotVoidType *other = first+tuplesize; other < 
end; other += tuplesize)
 
 2493                 for (
exint component = 0; component < (TSIZE >= 0 ? TSIZE : tuplesize); ++component)
 
 2495                     if (other[component] != first[component])
 
 2503             const exint bytesize = 
sizeof(
NotVoidType)*(TSIZE >= 0 ? TSIZE : tuplesize);
 
 2514                 if (!
isZero(first, (TSIZE >= 0 ? TSIZE : tuplesize)))
 
 2518                     memcpy(newfirst, first, bytesize);
 
 2537         template<
typename DEST_DATA_T>
 
 2545         template<
typename DEST_DATA_T>
 
 2558             return (myData == that.myData) && (myPRefCount == that.myPRefCount);
 
 2564             return (myData != that.myData) || (myPRefCount != that.myPRefCount);
 
 2586             exint new_count = cur_count-1;
 
 2588             if (prev_count == cur_count)
 
 2590             cur_count = prev_count;
 
 2600         UT_ASSERT_P(component >= 0 && component < tuplesize);
 
 2608             return page->getInlinePtr(tuplesize)[component];
 
 2620         return masked[component];
 
 2631         UT_ASSERT_P(component >= 0 && component < tuplesize);
 
 2637             return page->getInlinePtr(tuplesize) + component;
 
 2645         return masked + component;
 
 2668         bool wasconst = page->isConstant();
 
 2673         if (
sizeof(PageTableEntry) > 
sizeof(Tuple))
 
 2677             *(Tuple *)tuple = val;
 
 2693             else if (iszero || (page->isShared() && (*(
const Tuple*)masked != val)))
 
 2698             else if (!page->isShared())
 
 2701                 *(Tuple*)masked = val;
 
 2719         PageTableEntry newpage;
 
 2722         (*(Tuple*)tuple) = 
val;
 
 2723         newpage.setConstantBit();
 
 2738         bool wasconst = page->isConstant();
 
 2746             NotVoidType *tuple = page->getInlinePtr(tuplesize);
 
 2747             for (
exint i = 0; i < (TSIZE >= 0 ? TSIZE : tuplesize); ++i)
 
 2769             else if (page->isShared())
 
 2772                 for (
exint i = 0; i < (TSIZE >= 0 ? TSIZE : tuplesize); ++i)
 
 2774                     if (masked[i] != val)
 
 2793                 for (
exint i = 0; i < (TSIZE >= 0 ? TSIZE : tuplesize); ++i)
 
 2806         PageTableEntry newpage;
 
 2809         for (
exint i = 0; i < (TSIZE >= 0 ? TSIZE : tuplesize); ++i)
 
 2811         newpage.setConstantBit();
 
 2826         bool wasconst = page->isConstant();
 
 2834             NotVoidType *tuple = page->getInlinePtr(tuplesize);
 
 2835             for (
exint i = 0; i < (TSIZE >= 0 ? TSIZE : tuplesize); ++i)
 
 2836                 tuple[i] = values[i];
 
 2840         bool iszero = 
isZero(values, (TSIZE >= 0 ? TSIZE : tuplesize));
 
 2857             else if (page->isShared())
 
 2860                 for (
exint i = 0; i < (TSIZE >= 0 ? TSIZE : tuplesize); ++i)
 
 2862                     if (masked[i] != values[i])
 
 2881                 for (
exint i = 0; i < (TSIZE >= 0 ? TSIZE : tuplesize); ++i)
 
 2882                     masked[i] = values[i];
 
 2894         PageTableEntry newpage;
 
 2897         for (
exint i = 0; i < (TSIZE >= 0 ? TSIZE : tuplesize); ++i)
 
 2898             tuple[i] = values[i];
 
 2899         newpage.setConstantBit();
 
 2906     template<
typename SrcType>
 
 2915     template<
typename SrcType>
 
 2925     template<
typename SrcType>
 
 2930     template<
typename SrcNotVo
idType>
 
 2936     template<
typename SrcNotVo
idType>
 
 2941     template<
typename SrcNotVo
idType>
 
 2950         PageTableEntry newpage;
 
 2951         newpage.alloc(pagecapacity, tuplesize);
 
 2954         if (isinline ? page->isConstantAndZeroSafe() : page->isConstantZero())
 
 2956             memset(dest, 0, (
sizeof(
NotVoidType)*(TSIZE >= 0 ? TSIZE : tuplesize))*pagecapacity);
 
 2962                 src = page->getInlinePtr(tuplesize);
 
 2964                 src = page->getMaskedPtr();
 
 2966             for (
UT_PageOff i = 0; i < pagecapacity; ++i)
 
 2968                 for (
exint component = 0; component < tuplesize; ++component, ++dest)
 
 2969                     *dest = src[component];
 
 2984         PageTableEntry newpage;
 
 2985         newpage.alloc(pagecapacity, tuplesize);
 
 2988         if (!isinline && !page->isConstantZero())
 
 3002         PageTableEntry newpage;
 
 3003         newpage.alloc(pagecapacity, tuplesize);
 
 3006         memcpy(dest, src, (
sizeof(
NotVoidType)*(TSIZE >= 0 ? TSIZE : tuplesize))*pagecapacity);
 
 3020         PageTableEntry newpage;
 
 3021         newpage.alloc(pagecapacity, tuplesize);
 
 3052             UT_ASSERT_P(myCapacity > IDX_T(i << THEPAGEBITS));
 
 3057             UT_ASSERT_P(myCapacity > IDX_T(i << THEPAGEBITS));
 
 3085             if (PAGESHARDENED && newsize > mySize)
 
 3097                 for (
UT_PageNum p = startpage; p < endpage; ++p, ++page)
 
 3113             if (PAGESHARDENED && newsize > mySize)
 
 3124                 for (
UT_PageNum p = startpage; p < endpage; ++p, ++page)
 
 3145             const int64 new_count = myRefCount.
add(-1);
 
 3154             const size_t bytesize = 
sizeof(
NotVoidType)*((TSIZE >= 0) ? TSIZE : tuplesize);
 
 3159             for (
UT_PageNum p = 0; p < npages; ++p, ++page)
 
 3161                 if (page->
isRefd(bytesize))
 
 3166             printf(
"Free table %d pages (case 0);        %d tables total\n",
int(npages), 
int(thePageTableCount.add(-1)));
 
 3181             for (
UT_PageNum p = startpage; p < endpage; ++p, ++page)
 
 3197             for (
UT_PageNum p = startpage; p < endpage; ++p, ++page)
 
 3209                             pagesize = pagesizetemp;
 
 3227             if (pagenum+1 >= npages)
 
 3229                 if (pagenum+1 == npages)
 
 3233                         pagesize = pagesizetemp;
 
 3248             printf(
"Alloc table %d pages;        %d tables total\n",
int(npages), 
int(thePageTableCount.add(1)));
 
 3258             if (newcapacity == IDX_T(0))
 
 3261                     pages->
decRef(tuplesize);
 
 3268             bool wasshared = pages && pages->
isShared();
 
 3270             IDX_T oldcapacity = pages ? pages->
capacity() : IDX_T(0);
 
 3292                 if (nonconstfirst && newcapacity != oldcapacity)
 
 3298                     page->
realloc(sizetocopy, newpagecapacity, tuplesize);
 
 3303                 pages->myCapacity = newcapacity;
 
 3304                 if (pages->mySize > newcapacity)
 
 3305                     pages->mySize = newcapacity;
 
 3310             table->myCapacity = newcapacity;
 
 3317                 const bool willbesmallfirstpage = newcapacity < IDX_T(
thePageSize);
 
 3320                 table->mySize = pages->mySize;
 
 3325                 const size_t bytesize = 
sizeof(
NotVoidType)*((TSIZE >= 0) ? TSIZE : tuplesize);
 
 3332                     for (
UT_PageNum p = 0; p < minnpages; ++p, ++page)
 
 3334                         if (page->
isRefd(bytesize))
 
 3337                     pages->
decRef(tuplesize);
 
 3347                     for (
UT_PageNum p = npages; p < oldnpages; ++p, ++page)
 
 3349                         if (page->
isRefd(bytesize))
 
 3355                     printf(
"Free table %d pages (case 1);        %d tables total\n",
int(oldnpages), 
int(thePageTableCount.add(-1)));
 
 3362                 if (table->mySize > newcapacity)
 
 3363                     table->mySize = newcapacity;
 
 3370                 if (nonconstfirst && (wassmallfirstpage || willbesmallfirstpage) && newcapacity != oldcapacity)
 
 3375                     page->
realloc(sizetocopy, newpagecapacity, tuplesize);
 
 3381                 table->mySize = IDX_T(0);
 
 3386             for (
UT_PageNum p = oldnpages; p < npages; ++p, ++page)
 
 3391             if (PAGESHARDENED && wasshared)
 
 3429         const exint arraycapacity(
exint(pages->capacity()));
 
 3435         const exint arraycapacity(
exint(pages->capacity()));
 
 3441         const exint arraycapacity(
exint(pages->capacity()));
 
 3447         const exint arraycapacity(
exint(pages->capacity()));
 
 3453         const exint arraycapacity(
exint(pages->capacity()));
 
 3459         const exint arraycapacity(
exint(pages->capacity()));
 
 3465         const exint arraycapacity(
exint(pages->capacity()));
 
 3471         const exint arraycapacity(
exint(pages->capacity()));
 
 3479         if constexpr (SYSisSame<DATA_T,void>())
 
 3485                     UT_ASSERT_MSG_P(0, 
"Can't have a non-numeric type with a void DATA_T.");
 
 3507         PageTable *&pages = myImpl.getPages();
 
 3512     template<
typename T>
 
 3519         memset(&zero, 0, 
sizeof(
T));
 
 3520         return (val == zero);
 
 3523     template<
typename T>
 
 3534         memset(&zero, 0, 
sizeof(
T));
 
 3537         for (
exint i = 1; i < tuplesize; ++i)
 
 3538             iszero &= (val[i] == zero);
 
 3542     template<
typename T0,
typename T1>
 
 3549         for (
exint i = 0; i < tuplesize; ++i)
 
 3557     template<
typename DEST_TYPE,
typename SRC_TYPE,ex
int SRC_TSIZE>
 
 3561         if constexpr (SYSisSame<DEST_TYPE,SRC_TYPE>())
 
 3566             for (
exint i = 0; i < SRC_TSIZE; ++i)
 
 3567                 dest[i] = UTconvertStorage<DEST_TYPE>(src[i]);
 
 3584     template<ex
int ITSIZE, 
typename IDATA_T>
 
 3586         private ImplPageData,
 
 3590         SYS_FORCE_INLINE const PageTable *getPages()
 const { 
return ImplPageData::myPages; }
 
 3598     Impl<TSIZE,DATA_T> myImpl;
 
void hardenAllPages(IDX_T start, IDX_T end, exint tuplesize=TSIZE)
 
SYS_FORCE_INLINE NotVoidType operator()(IDX_T i, exint component=0) const 
Read element i's specified component (default component 0). 
 
static void hardenConstantPageNoInit(PageTable *pages, PageTableEntry *page)
 
static void copyNonConst(NotVoidType *destpagedata, const SrcNotVoidType *srcpagedata, exint desttuplesize, exint srctuplesize, UT_PageOff ntuples)
 
SYS_FORCE_INLINE bool isPageConstant(UT_PageNum pagenum) const 
Returns true iff the specified page is constant-compressed. 
 
static void hardenConstantPage(PageTable *pages, PageTableEntry *page, exint tuplesize)
 
SYS_FORCE_INLINE void opVector(IDX_T i, const UT_FixedVector< SRC_DATA_T, SRC_TSIZE > &v)
 
static SYS_FORCE_INLINE const NotVoidType * getConstantPtr(const PageTableEntry *page, exint component=0, exint tuplesize=TSIZE)
 
SYS_FORCE_INLINE void setSize(IDX_T newsize)
 
static SYS_FORCE_INLINE bool decCounterIffAbove1(SYS_AtomicCounter &counter)
 
SYS_FORCE_INLINE const NotVoidType * getInlinePtr(exint tuplesize) const 
Returns the data pointer, if an inline constant page. 
 
SYS_FORCE_INLINE void * getFirstPtrVoid()
Returns the data pointer, if not a constant page. 
 
static void hardenSharedPageNoInit(PageTableEntry *page, UT_PageOff pagecapacity, exint tuplesize=TSIZE)
 
void hardenAllPagesUnknownType(IDX_T start, IDX_T end)
 
void tryCompressPage(UT_PageOff pagesize, exint tuplesize=TSIZE)
 
static ThisType * harden(ThisType *pages, IDX_T newcapacity, exint tuplesize=TSIZE)
 
static void hardenSharedPage(PageTable *pages, PageTableEntry *page, exint tuplesize)
 
SYS_FORCE_INLINE bool isArrayZero() const 
Returns true iff the entire array is constant & zero. 
 
static const UT_Storage theStorage
 
static SYS_FORCE_INLINE NotVoidType getConstant(const PageTableEntry *const page, exint component, exint tuplesize=TSIZE)
 
NotVoid< DATA_T >::type NotVoidType
 
UT_PageArray(const ThisType &that)
 
void setTupleSize(exint newtuplesize, const UT_Defaults &v)
 
static ThisType * alloc(UT_PageNum npages)
 
void tryCompressPage(UT_PageNum pagenum, exint tuplesize=TSIZE)
 
SYS_FORCE_INLINE const NotVoidType * getMaskedPtr() const 
 
getFileOption("OpenEXR:storage") storage
 
void copy(IDX_T dest, IDX_T src)
Copies a single element from src to dest within this. 
 
void tryCompressAllPagesUnknownType(IDX_T start, IDX_T end)
 
auto printf(const S &fmt, const T &...args) -> int
 
SYS_FORCE_INLINE ~UT_PageArray()
 
SYS_FORCE_INLINE bool operator!=(const ThisType &that) const 
NOTE: This just does a shallow comparison. 
 
void tryCompressAllPages(IDX_T start, IDX_T end, exint tuplesize=TSIZE)
 
constexpr const T * data() const noexcept
 
SYS_FORCE_INLINE void clear()
 
SYS_FORCE_INLINE ThisType & operator=(const UT_PageArray< SRC_DATA_T, SRC_TSIZE, SRC_TABLEHARDENED, SRC_PAGESHARDENED, THEPAGEBITS, IDX_T > &that)
 
static void hardenSharedPageNoInit(PageTable *pages, PageTableEntry *page, exint tuplesize)
 
void opVectorUnknownType(IDX_T i, const UT_FixedVector< SRC_DATA_T, SRC_TSIZE > &v)
 
SYS_FORCE_INLINE IDX_T size() const 
 
SYS_FORCE_INLINE T * SYSconst_cast(const T *foo)
 
constexpr UT_FixedVector< SYS_FixedArrayElement_t< TS >, SYS_FixedArraySize_v< TS > > UTmakeFixedVector(const TS &as) noexcept
 
SYS_FORCE_INLINE void add(IDX_T i, SRC_DATA_T v)
component == 0 in this version 
 
UT_FixedVector< DEST_DATA_T, DEST_TSIZE > getVectorUnknownSize(IDX_T i) const 
 
SYS_FORCE_INLINE void relaxedStore(T val)
 
SYS_FORCE_INLINE bool isShared() const 
 
void countMemory(UT_MemoryCounter &counter, bool inclusive) const 
 
SYS_FORCE_INLINE PageTableEntry * getFirstPage()
 
GLboolean GLboolean GLboolean GLboolean a
 
static void hardenSharedPageNoInit(PageTable *pages, PageTableEntry *page)
 
void setConstant(IDX_T start, IDX_T end, NotVoidType v)
 
void opUnknownType(IDX_T i, exint component, SRC_DATA_T v)
 
SYS_FORCE_INLINE const PageTableEntry * getPPage(UT_PageNum i) const 
 
static void hardenConstantPage(PageTable *pages, PageTableEntry *page)
 
IMATH_HOSTDEVICE constexpr bool equal(T1 a, T2 b, T3 t) IMATH_NOEXCEPT
 
SYS_FORCE_INLINE UT_PageArray< DATA_T, TSIZE, true, true, THEPAGEBITS, IDX_T > & hardenAllPages(IDX_T start=IDX_T(0), IDX_T end=IDX_T(-1))
 
static const exint theTupleSize
 
SYS_FORCE_INLINE UT_PageArray< DEST_DATA_T, TSIZE, TABLEHARDENED, PAGESHARDENED, THEPAGEBITS, IDX_T >::PageTableEntry * castType()
 
SYS_FORCE_INLINE exint getTupleSize() const 
 
DEST_DATA_T getUnknownType(IDX_T i, exint component=0) const 
 
SYS_SelectType< T, float, SYS_IsSame< T, void >::value >::type type
 
#define UT_ASSERT_MSG_P(ZZ,...)
 
SYS_FORCE_INLINE IDX_T size() const 
NOTE: This is the size of the full array, not the number of pages. 
 
SYS_FORCE_INLINE UT_FixedVector< DEST_DATA_T, DEST_TSIZE > getVector(IDX_T i) const 
 
#define UT_IF_ASSERT_P(ZZ)
 
SYS_FORCE_INLINE void set(IDX_T i, SRC_DATA_T v)
component == 0 in this version 
 
SYS_FORCE_INLINE UT_Storage getStorage() const 
 
static SYS_FORCE_INLINE IDX_T roundUpCapacity(IDX_T capacity)
 
SYS_FORCE_INLINE bool isTableHardened() const 
Returns true iff the table isn't shared with any other UT_PageArray's. 
 
SYS_FORCE_INLINE exint getRefCount() const 
 
SYS_FORCE_INLINE UT_PageArray< DATA_T, DEST_TSIZE, TABLEHARDENED, PAGESHARDENED, THEPAGEBITS, IDX_T > & castTupleSize()
 
bool hasNanInRange(IDX_T start, IDX_T end) const 
 
void setVectorRange(IDX_T deststart, IDX_T nelements, const UT_FixedVector< SRC_DATA_T, SRC_TSIZE > *src)
 
UT_PageArray(const UT_PageArray< SRC_DATA_T, SRC_TSIZE, SRC_TABLEHARDENED, SRC_PAGESHARDENED, THEPAGEBITS, IDX_T > &that)
 
UT_PageArray(exint tuplesize, UT_Storage storage)
 
void tryCompressPageUnknownType(UT_PageNum pagenum)
 
void decRef(exint tuplesize)
 
SYS_FORCE_INLINE bool isShared() const 
 
void fill(IDX_T start, IDX_T end, const NotVoidType &val)
 
static bool isEqualConst(const NotVoidType *tuple, const SrcNotVoidType *stuple, exint mintuplesize)
 
SYS_FORCE_INLINE void setConstantBit()
 
#define UT_ASSERT_MSG(ZZ,...)
 
UT_FixedVector< DEST_DATA_T, DEST_TSIZE > getVectorMismatchedSize(IDX_T i) const 
 
UT_FixedVector< DEST_DATA_T, DEST_TSIZE > getVectorUnknownType(IDX_T i) const 
 
SYS_FORCE_INLINE exint getRefCount() const 
 
SYS_FORCE_INLINE bool isConstantZero() const 
This is only valid to call if the type doesn't fit inline. 
 
SYS_FORCE_INLINE void setSize(IDX_T newsize, exint tuplesize)
 
static SYS_FORCE_INLINE UT_PageOff pageOff(IDX_T i)
 
UT_PageArray(UT_Storage storage)
 
SYS_FORCE_INLINE void tryCompressPage(UT_PageNum pagenum)
 
SYS_FORCE_INLINE ThisType & operator=(const ThisType &that)
 
static SYS_FORCE_INLINE bool typeFitsInline(exint tuplesize=TSIZE)
This is only valid to call when DATA_T is non-void. 
 
SYS_FORCE_INLINE const PageTableEntry * getFirstPage() const 
 
SYS_FORCE_INLINE void setPageConstant(UT_PageNum pagenum, const UT_FixedVector< SRC_DATA_T, theSafeTupleSize > &val)
 
static SYS_FORCE_INLINE UT_PageNum numPages(IDX_T nelements)
 
static SYS_FORCE_INLINE bool isEqual(const T0 *a, const T1 *b, exint tuplesize)
 
SYS_FORCE_INLINE void getRange(IDX_T srcstart, IDX_T nelements, T *dest) const 
 
SYS_FORCE_INLINE bool isRefd(exint tuplebytes) const 
 
SYS_FORCE_INLINE bool operator==(const ThisType &that) const 
NOTE: This just does a shallow comparison. 
 
SYS_FORCE_INLINE void setPageConstant(UT_PageNum pagenum, const NotVoidType &val)
 
SYS_FORCE_INLINE IDX_T capacity() const 
NOTE: This is the capacity of the full array, not the capacity of pages. 
 
static SYS_FORCE_INLINE bool isZero(const T &val)
 
SYS_FORCE_INLINE IDX_T capacity() const 
 
T compare_swap(T expected, T desired)
 
SYS_FORCE_INLINE NotVoidType * hardenPage(UT_PageNum pagenum)
 
UT_FixedVector< NotVoidType, theSafeTupleSize > Tuple
 
SYS_FORCE_INLINE void op(IDX_T i, exint component, SRC_DATA_T v)
 
SYS_FORCE_INLINE NotVoidType * getInlinePtr(exint tuplesize)
Returns the data pointer, if an inline constant page. 
 
void setCapacity(IDX_T newcapacity)
 
SYS_FORCE_INLINE void * getMaskedPtrVoid()
 
static SYS_FORCE_INLINE UT_PageOff pageStart(IDX_T page)
 
UT_PageArray(exint tuplesize)
 
SYS_FORCE_INLINE const void * getFirstPtrVoidUnsafe() const 
 
static void copyPartialPage(PageTableEntry *dest, const typename SrcType::PageTableEntry *src, exint desttuplesize, exint srctuplesize, UT_PageOff destoff, UT_PageOff srcoff, UT_PageOff ntuples, UT_PageOff destpagecapacity)
 
SYS_FORCE_INLINE bool isConstantAndZeroSafe() const 
 
void setPageConstantUnknownType(UT_PageNum pagenum, const UT_FixedVector< SRC_DATA_T, theSafeTupleSize > &val)
 
SYS_FORCE_INLINE bool decRefIffShared(exint tuplesize=TSIZE)
 
static void makeConstant(PageTableEntry *page, const NotVoidType *values, exint tuplesize)
 
SYS_FORCE_INLINE NotVoidType * hardenPageNoInit(UT_PageNum pagenum)
 
GLboolean GLboolean GLboolean b
 
SYS_FORCE_INLINE void tryCompressAllPages(IDX_T start=IDX_T(0), IDX_T end=IDX_T(-1))
 
static const exint thePageBits
 
SYS_FORCE_INLINE void add(IDX_T i, exint component, SRC_DATA_T v)
 
const NotVoidType * getPageData(UT_PageNum pagenum) const 
 
static const exint theSafeTupleSize
 
SYS_FORCE_INLINE void incRef()
 
GLenum GLenum GLsizei void * table
 
void realloc(UT_PageOff sizetocopy, UT_PageOff newpagecapacity, exint tuplesize=TSIZE)
 
static void makeConstantFrom(PageTableEntry *dest, const typename SrcType::PageTableEntry *src, exint desttuplesize, exint srctuplesize)
 
SYS_FORCE_INLINE void setPageConstant(UT_PageNum pagenum, const SRC_DATA_T *values)
 
SYS_FORCE_INLINE void addVector(IDX_T i, const TS &as)
 
SYS_FORCE_INLINE T relaxedLoad() const 
 
void moveRange(IDX_T srcstart, IDX_T deststart, IDX_T nelements)
 
static const exint thePageMask
 
static void hardenConstantPageNoInit(PageTable *pages, PageTableEntry *page, exint tuplesize)
 
static const uintptr_t theConstantPageBit
 
SYS_FORCE_INLINE int64 getMemoryUsage(exint tuplebytes) const 
 
SYS_AtomicInt< int32 > SYS_AtomicCounter
 
SYS_FORCE_INLINE const UT_PageArray< DEST_DATA_T, TSIZE, TABLEHARDENED, PAGESHARDENED, THEPAGEBITS, IDX_T > & castType() const 
 
void setSize(IDX_T newsize)
 
SYS_FORCE_INLINE const void * getMaskedPtrVoid() const 
 
SYS_FORCE_INLINE const UT_PageArray< DEST_DATA_T, TSIZE, TABLEHARDENED, PAGESHARDENED, THEPAGEBITS, IDX_T >::PageTableEntry * castType() const 
 
GLenum GLsizei GLsizei GLint * values
 
void swapRange(IDX_T astart, IDX_T bstart, IDX_T nelements)
 
SYS_FORCE_INLINE void * getFirstPtrVoidUnsafe()
 
bool decRefIffSharedPage(UT_PageNum pagenum)
 
void setPageConstantUnknownType(UT_PageNum pagenum, const SRC_DATA_T *values)
 
SYS_FORCE_INLINE PageTableEntry * getPPage(UT_PageNum i)
 
void setStorage(const UT_Storage newstorage)
 
IMATH_HOSTDEVICE constexpr bool iszero(T a, T t) IMATH_NOEXCEPT
 
SYS_FORCE_INLINE void set(IDX_T i, exint component, SRC_DATA_T v)
 
static void hardenConstantPageNoInit(PageTableEntry *page, UT_PageOff pagecapacity, exint tuplesize=TSIZE)
 
static void fillNonConstWithConst(NotVoidType *destpagedata, NotVoidType *destpageend, const SrcNotVoidType *stuple, exint mintuplesize, exint desttupleextra)
 
SYS_FORCE_INLINE NotVoidType * getMaskedPtr()
 
bool decRefIffSharedTable()
 
SYS_FORCE_INLINE const UT_PageArray< DATA_T, DEST_TSIZE, TABLEHARDENED, PAGESHARDENED, THEPAGEBITS, IDX_T > & castTupleSize() const 
 
SYS_FORCE_INLINE bool isConstant() const 
This is always valid to call. 
 
SYS_FORCE_INLINE void setRange(IDX_T deststart, IDX_T nelements, const T *src)
 
static void hardenSharedPage(PageTableEntry *page, UT_PageOff pagecapacity, exint tuplesize=TSIZE)
 
SYS_FORCE_INLINE const void * getFirstPtrVoid() const 
Returns the data pointer, if not a constant page. 
 
static SYS_FORCE_INLINE NotVoidType * getConstantPtr(PageTableEntry *page, exint component=0, exint tuplesize=TSIZE)
 
static SYS_FORCE_INLINE void makeConstant(PageTableEntry *page, const UT_FixedVector< NotVoidType, theSafeTupleSize > &val)
 
static SYS_FORCE_INLINE UT_FixedVector< DEST_TYPE, SRC_TSIZE > convertVectorStorage(const UT_FixedVector< SRC_TYPE, SRC_TSIZE > &src)
 
static void makeConstant(PageTableEntry *page, const NotVoidType &val, exint tuplesize=TSIZE)
 
SYS_FORCE_INLINE UT_PageArray< DATA_T, TSIZE, true, PAGESHARDENED, THEPAGEBITS, IDX_T > & hardenTable()
 
static const exint thePageSize
 
static SYS_FORCE_INLINE bool isZero(const T *val, exint tuplesize)
 
SYS_FORCE_INLINE void alloc(UT_PageOff nelements, exint tuplesize=TSIZE)
 
T add(T val)
Atomically adds val to myValue, returning the new value of myValue. 
 
static void hardenConstantPage(PageTableEntry *page, UT_PageOff pagecapacity, exint tuplesize=TSIZE)
 
int64 getMemoryUsage(bool inclusive) const 
 
static SYS_FORCE_INLINE UT_PageNum pageNum(IDX_T i)
 
UT_PageArray< DATA_T, TSIZE, TABLEHARDENED, PAGESHARDENED, THEPAGEBITS, IDX_T > ThisType
 
static void hardenSharedPage(PageTable *pages, PageTableEntry *page)
 
void setCapacityIfNeeded(IDX_T newcapacity)
 
SYS_FORCE_INLINE void setVector(IDX_T i, const TS &as)
 
void getVectorRange(IDX_T srcstart, IDX_T nelements, UT_FixedVector< DEST_DATA_T, DEST_TSIZE > *dest) const 
 
void forceHardenTable(IDX_T newcapacity)
 
SYS_FORCE_INLINE int64 getGuaranteedInt(IDX_T i) const 
 
SYS_FORCE_INLINE NotVoidType * unshareConstantPage(UT_PageNum pagenum)
 
SYS_FORCE_INLINE bool isPageHard(UT_PageNum pagenum) const 
 
UT_PageArray< DATA_T, TSIZE, TABLEHARDENED, PAGESHARDENED, THEPAGEBITS, IDX_T > ParentType
 
SYS_FORCE_INLINE constexpr int UTstorageSize(UT_Storage storage)
Returns the number of bytes in the given storage type. 
 
SYS_FORCE_INLINE void initZero()
 
SYS_FORCE_INLINE const NotVoidType * getFirstPtr() const 
Returns the data pointer, if not a constant page. 
 
SYS_FORCE_INLINE NotVoidType * getFirstPtr()
Returns the data pointer, if not a constant page. 
 
void setPageConstantMismatchedType(UT_PageNum pagenum, const SRC_DATA_T *values)
 
void replace(const UT_PageArray< SRC_DATA_T, SRC_TSIZE, SRC_TABLEHARDENED, SRC_PAGESHARDENED, THEPAGEBITS, IDX_T > &that)
 
SYS_FORCE_INLINE NotVoidType & operator()(IDX_T i, exint component=0)
 
NotVoidType * getPageData(UT_PageNum pagenum)
 
SYS_FORCE_INLINE void decRef()
 
static void replacePage(PageTableEntry *dest, const typename SrcType::PageTableEntry *src, exint desttuplesize, exint srctuplesize, UT_PageOff destpagesize, UT_PageOff destpagecapacity)
 
SYS_FORCE_INLINE UT_PageArray< DEST_DATA_T, TSIZE, TABLEHARDENED, PAGESHARDENED, THEPAGEBITS, IDX_T > & castType()