Skip to content

Commit

Permalink
[ntuple] add assert()s in RPage(Pool) logic
Browse files Browse the repository at this point in the history
  • Loading branch information
jblomer committed Nov 15, 2024
1 parent 77ae704 commit 0bc26ca
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
2 changes: 2 additions & 0 deletions tree/ntuple/v7/inc/ROOT/RPage.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@

#include <ROOT/RNTupleUtil.hxx>

#include <cassert>
#include <cstddef>
#include <cstdint>
#include <memory>
Expand Down Expand Up @@ -152,6 +153,7 @@ public:
/// return value is ignored.
void *GrowUnchecked(ClusterSize_t::ValueType nElements)
{
assert(fNElements + nElements <= fMaxElements);
auto offset = GetNBytes();
fNElements += nElements;
return static_cast<unsigned char *>(fBuffer) + offset;
Expand Down
1 change: 1 addition & 0 deletions tree/ntuple/v7/src/RPagePool.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ void ROOT::Experimental::Internal::RPagePool::ReleasePage(const RPage &page)
const auto idx = itrLookup->second;
const auto N = fEntries.size();

assert(fEntries[idx].fRefCounter >= 1);
if (--fEntries[idx].fRefCounter == 0) {
fLookupByBuffer.erase(itrLookup);

Expand Down

0 comments on commit 0bc26ca

Please sign in to comment.