Skip to content

Commit fa3d2d4

Browse files
committed
Remove AttributeArray out-of-core atomic
Signed-off-by: Dan Bailey <danbailey@ilm.com>
1 parent d3801c4 commit fa3d2d4

2 files changed

Lines changed: 3 additions & 7 deletions

File tree

openvdb/openvdb/points/AttributeArray.cc

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,6 @@ AttributeArray::AttributeArray(const AttributeArray& rhs, const tbb::spin_mutex:
6161
: mIsUniform(rhs.mIsUniform)
6262
, mFlags(rhs.mFlags)
6363
, mUsePagedRead(rhs.mUsePagedRead)
64-
, mOutOfCore(rhs.mOutOfCore.load())
6564
, mPageHandle()
6665
{
6766
if (mFlags & PARTIALREAD) mCompressedBytes = rhs.mCompressedBytes;
@@ -78,7 +77,6 @@ AttributeArray::operator=(const AttributeArray& rhs)
7877
mIsUniform = rhs.mIsUniform;
7978
mFlags = rhs.mFlags;
8079
mUsePagedRead = rhs.mUsePagedRead;
81-
mOutOfCore.store(rhs.mOutOfCore);
8280
if (mFlags & PARTIALREAD) mCompressedBytes = rhs.mCompressedBytes;
8381
else if (rhs.mPageHandle) mPageHandle = rhs.mPageHandle->copy();
8482
else mPageHandle.reset();

openvdb/openvdb/points/AttributeArray.h

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -363,10 +363,12 @@ class OPENVDB_API AttributeArray
363363
mutable tbb::spin_mutex mMutex;
364364
uint8_t mFlags = 0;
365365
uint8_t mUsePagedRead = 0;
366+
#if OPENVDB_ABI_VERSION_NUMBER < 14
366367
std::atomic<Index32> mOutOfCore{0}; // interpreted as bool
368+
#endif
367369
/// used for out-of-core, paged reading
368370
union {
369-
compression::PageHandle::Ptr mPageHandle;
371+
std::unique_ptr<compression::PageHandle> mPageHandle;
370372
size_t mCompressedBytes;
371373
};
372374
}; // class AttributeArray
@@ -1535,8 +1537,6 @@ TypedAttributeArray<ValueType_, Codec_>::readBuffers(std::istream& is)
15351537
OPENVDB_THROW(IoError, "Cannot read paged AttributeArray buffers.");
15361538
}
15371539

1538-
tbb::spin_mutex::scoped_lock lock(mMutex);
1539-
15401540
this->deallocate();
15411541

15421542
uint8_t bloscCompressed(0);
@@ -1586,8 +1586,6 @@ TypedAttributeArray<ValueType_, Codec_>::readPagedBuffers(compression::PagedInpu
15861586

15871587
OPENVDB_ASSERT(mPageHandle);
15881588

1589-
tbb::spin_mutex::scoped_lock lock(mMutex);
1590-
15911589
this->deallocate();
15921590

15931591
is.read(mPageHandle, std::streamsize(mPageHandle->size()), false);

0 commit comments

Comments
 (0)