Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 1 addition & 4 deletions tree/ntuple/src/RFieldSequenceContainer.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -287,10 +287,7 @@
}

// TODO Increment capacity by a factor rather than just enough to fit the elements.
if (owns) {
// *beginPtr points to the array of item values (allocated in an earlier call by the following malloc())
free(*beginPtr);
}
Internal::DestroyRVecWithChecks(itemField->GetAlignment(), beginPtr, capacityPtr);

Check failure on line 290 in tree/ntuple/src/RFieldSequenceContainer.cxx

View workflow job for this annotation

GitHub Actions / alma10 clang CMAKE_C_COMPILER=clang, CMAKE_CXX_COMPILER=clang++

use of undeclared identifier 'itemField'

Check failure on line 290 in tree/ntuple/src/RFieldSequenceContainer.cxx

View workflow job for this annotation

GitHub Actions / alma10 clang CMAKE_C_COMPILER=clang, CMAKE_CXX_COMPILER=clang++

no member named 'DestroyRVecWithChecks' in namespace 'ROOT::Internal'; did you mean simply 'DestroyRVecWithChecks'?

Check failure on line 290 in tree/ntuple/src/RFieldSequenceContainer.cxx

View workflow job for this annotation

GitHub Actions / alma9 CMAKE_BUILD_TYPE=Debug

‘itemField’ was not declared in this scope

Check failure on line 290 in tree/ntuple/src/RFieldSequenceContainer.cxx

View workflow job for this annotation

GitHub Actions / alma9 CMAKE_BUILD_TYPE=Debug

‘DestroyRVecWithChecks’ is not a member of ‘ROOT::Internal’; did you mean ‘{anonymous}::DestroyRVecWithChecks’?

Check failure on line 290 in tree/ntuple/src/RFieldSequenceContainer.cxx

View workflow job for this annotation

GitHub Actions / alma10

‘itemField’ was not declared in this scope

Check failure on line 290 in tree/ntuple/src/RFieldSequenceContainer.cxx

View workflow job for this annotation

GitHub Actions / alma10

‘DestroyRVecWithChecks’ is not a member of ‘ROOT::Internal’; did you mean ‘{anonymous}::DestroyRVecWithChecks’?

Check failure on line 290 in tree/ntuple/src/RFieldSequenceContainer.cxx

View workflow job for this annotation

GitHub Actions / alma10 arm64 CMAKE_BUILD_TYPE=RelWithDebInfo, builtin_zlib=ON, builtin_zstd=ON

‘itemField’ was not declared in this scope

Check failure on line 290 in tree/ntuple/src/RFieldSequenceContainer.cxx

View workflow job for this annotation

GitHub Actions / alma10 arm64 CMAKE_BUILD_TYPE=RelWithDebInfo, builtin_zlib=ON, builtin_zstd=ON

‘DestroyRVecWithChecks’ is not a member of ‘ROOT::Internal’; did you mean ‘{anonymous}::DestroyRVecWithChecks’?

Check failure on line 290 in tree/ntuple/src/RFieldSequenceContainer.cxx

View workflow job for this annotation

GitHub Actions / debian125 CMAKE_CXX_STANDARD=20, dev=ON

‘itemField’ was not declared in this scope

Check failure on line 290 in tree/ntuple/src/RFieldSequenceContainer.cxx

View workflow job for this annotation

GitHub Actions / debian125 CMAKE_CXX_STANDARD=20, dev=ON

‘DestroyRVecWithChecks’ is not a member of ‘ROOT::Internal’; did you mean ‘{anonymous}::DestroyRVecWithChecks’?

Check failure on line 290 in tree/ntuple/src/RFieldSequenceContainer.cxx

View workflow job for this annotation

GitHub Actions / ubuntu2604

‘itemField’ was not declared in this scope

Check failure on line 290 in tree/ntuple/src/RFieldSequenceContainer.cxx

View workflow job for this annotation

GitHub Actions / ubuntu2604

‘DestroyRVecWithChecks’ is not a member of ‘ROOT::Internal’; did you mean ‘{anonymous}::DestroyRVecWithChecks’?

Check failure on line 290 in tree/ntuple/src/RFieldSequenceContainer.cxx

View workflow job for this annotation

GitHub Actions / alma9 march_native CMAKE_BUILD_TYPE=RelWithDebInfo, CMAKE_CXX_FLAGS=-march=native, CMAKE_C_FLAGS=-march=native, builtin_zlib=ON, builtin_zstd=ON

‘itemField’ was not declared in this scope

Check failure on line 290 in tree/ntuple/src/RFieldSequenceContainer.cxx

View workflow job for this annotation

GitHub Actions / alma9 march_native CMAKE_BUILD_TYPE=RelWithDebInfo, CMAKE_CXX_FLAGS=-march=native, CMAKE_C_FLAGS=-march=native, builtin_zlib=ON, builtin_zstd=ON

‘DestroyRVecWithChecks’ is not a member of ‘ROOT::Internal’; did you mean ‘{anonymous}::DestroyRVecWithChecks’?

Check failure on line 290 in tree/ntuple/src/RFieldSequenceContainer.cxx

View workflow job for this annotation

GitHub Actions / mac15 ARM64 CMAKE_CXX_STANDARD=23

use of undeclared identifier 'itemField'

Check failure on line 290 in tree/ntuple/src/RFieldSequenceContainer.cxx

View workflow job for this annotation

GitHub Actions / mac15 ARM64 CMAKE_CXX_STANDARD=23

no member named 'DestroyRVecWithChecks' in namespace 'ROOT::Internal'

Check failure on line 290 in tree/ntuple/src/RFieldSequenceContainer.cxx

View workflow job for this annotation

GitHub Actions / alma9 modules_off runtime_cxxmodules=Off

‘itemField’ was not declared in this scope

Check failure on line 290 in tree/ntuple/src/RFieldSequenceContainer.cxx

View workflow job for this annotation

GitHub Actions / alma9 modules_off runtime_cxxmodules=Off

‘DestroyRVecWithChecks’ is not a member of ‘ROOT::Internal’; did you mean ‘{anonymous}::DestroyRVecWithChecks’?

Check failure on line 290 in tree/ntuple/src/RFieldSequenceContainer.cxx

View workflow job for this annotation

GitHub Actions / alma8

‘itemField’ was not declared in this scope

Check failure on line 290 in tree/ntuple/src/RFieldSequenceContainer.cxx

View workflow job for this annotation

GitHub Actions / alma8

‘DestroyRVecWithChecks’ is not a member of ‘ROOT::Internal’

Check failure on line 290 in tree/ntuple/src/RFieldSequenceContainer.cxx

View workflow job for this annotation

GitHub Actions / ubuntu2404 CMAKE_BUILD_TYPE=Debug

‘itemField’ was not declared in this scope

Check failure on line 290 in tree/ntuple/src/RFieldSequenceContainer.cxx

View workflow job for this annotation

GitHub Actions / ubuntu2404 CMAKE_BUILD_TYPE=Debug

‘DestroyRVecWithChecks’ is not a member of ‘ROOT::Internal’; did you mean ‘{anonymous}::DestroyRVecWithChecks’?

Check failure on line 290 in tree/ntuple/src/RFieldSequenceContainer.cxx

View workflow job for this annotation

GitHub Actions / ubuntu22 imt=Off, CMAKE_BUILD_TYPE=Debug

‘itemField’ was not declared in this scope

Check failure on line 290 in tree/ntuple/src/RFieldSequenceContainer.cxx

View workflow job for this annotation

GitHub Actions / ubuntu22 imt=Off, CMAKE_BUILD_TYPE=Debug

‘DestroyRVecWithChecks’ is not a member of ‘ROOT::Internal’; did you mean ‘{anonymous}::DestroyRVecWithChecks’?

Check failure on line 290 in tree/ntuple/src/RFieldSequenceContainer.cxx

View workflow job for this annotation

GitHub Actions / mac26 ARM64

use of undeclared identifier 'itemField'

Check failure on line 290 in tree/ntuple/src/RFieldSequenceContainer.cxx

View workflow job for this annotation

GitHub Actions / mac26 ARM64

no member named 'DestroyRVecWithChecks' in namespace 'ROOT::Internal'; did you mean simply 'DestroyRVecWithChecks'?

Check failure on line 290 in tree/ntuple/src/RFieldSequenceContainer.cxx

View workflow job for this annotation

GitHub Actions / mac14 X64 CMAKE_CXX_STANDARD=20

use of undeclared identifier 'itemField'

Check failure on line 290 in tree/ntuple/src/RFieldSequenceContainer.cxx

View workflow job for this annotation

GitHub Actions / mac14 X64 CMAKE_CXX_STANDARD=20

no member named 'DestroyRVecWithChecks' in namespace 'ROOT::Internal'
// We trust that malloc returns a buffer with large enough alignment.
// This might not be the case if T in RVec<T> is over-aligned.
*beginPtr = malloc(nItems * fItemSize);
Expand Down
33 changes: 33 additions & 0 deletions tree/ntuple/test/rfield_vector.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,39 @@ TEST(RNTuple, RVec)
EXPECT_EQ(1.0, (*rdJetsAsStdVector)[0]);
}

TEST(RNTuple, RVecResizeSmall)
{
FileRaii fileGuard("test_ntuple_rvec_small.root");

constexpr int N = 260; // more elements than fit in any small vector storage

{
auto model = RNTupleModel::Create();
auto v = model->MakeField<ROOT::RVec<int>>("v");
for (int i = 0; i < N; ++i) {
v->push_back(i);
}

auto writer = RNTupleWriter::Recreate(std::move(model), "ntpl", fileGuard.GetPath());
writer->Fill();
}

auto reader = RNTupleReader::Open("ntpl", fileGuard.GetPath());
EXPECT_EQ(1U, reader->GetNEntries());

ROOT::RVec<int> v;
EXPECT_TRUE(ROOT::Detail::VecOps::IsSmall(v));
auto e = reader->CreateEntry();
e->BindRawPtr("v", &v);

reader->LoadEntry(0, *e);
ASSERT_EQ(v.size(), N);
EXPECT_FALSE(ROOT::Detail::VecOps::IsSmall(v));
for (int i = 0; i < N; ++i) {
EXPECT_EQ(i, v[i]);
}
}

TEST(RNTuple, RVecTypeErased)
{
FileRaii fileGuard("test_ntuple_rvec_typeerased.root");
Expand Down
Loading