Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
e3500df
[ntuple] fix argument comment
jblomer May 26, 2026
0b98a8f
[io] fix casting through void
jblomer May 26, 2026
e545ba8
[RVec] avoid unnecessary capacity check in internal set_size
jblomer May 27, 2026
6b402ca
[ntuple] avoid throwing impossible exception
jblomer May 27, 2026
cedaea4
[ntuple] don't throw in RNTupleModel::~RUpdater()
jblomer May 27, 2026
6abc741
[ntuple] safer use of RException
jblomer May 27, 2026
ffb178c
[core] make RException nothrow copy constructible
jblomer May 27, 2026
a7d6408
[ntuple] fix throwing exception in RNTupleDescriptor
jblomer May 27, 2026
838273e
[ntuple] remove wrong forward declaration of RFieldVisitor
jblomer May 27, 2026
b919ead
[core] fix definition of kMaxULong
jblomer May 27, 2026
9122b4e
[ntuple] minor improvement in optional assignments
jblomer May 27, 2026
fc654ab
[meta] remove unused TClassEdit::GetUniquePtrType()
jblomer May 27, 2026
bf42867
[ntuple] minor readability improvement
jblomer May 27, 2026
9d97c8e
[ntuple] minor improvement in RPageSourceFile::CreateFromAnchor()
jblomer May 27, 2026
f8b95cb
[ntuple] remove unused variable in RFieldBase::Create()
jblomer May 27, 2026
5358831
[ntuple] fix use-after-move in RNTupleDescriptorBuilder::AddColumn()
jblomer May 27, 2026
3b12904
[NFC][ntuple] suppress clang-tidy false positive
jblomer May 27, 2026
3e68499
[ntuple] fix widening method visibility change
jblomer May 27, 2026
805465b
[ntuple] remove unusued usings
jblomer May 27, 2026
44a761c
[ntuple] private linkage of stream operator in the merger
jblomer May 27, 2026
2d9a47a
[ntuple] replace std::endl by \n
jblomer May 27, 2026
6f54a11
[ntuple] minor performance improvement in RPageSourceFile::LoadCluste…
jblomer May 27, 2026
e0bf5d5
[core] pass RError::RLocation by const ref
jblomer May 27, 2026
dddfd6f
[ntuple] use member move in RValue move ctor
jblomer May 27, 2026
708b6af
[ntuple] minor perf improvement in type name normalization
jblomer May 27, 2026
4a8fd72
[ntuple] make moving RPage(Ref) noexcept
jblomer May 27, 2026
89ba1d4
[ntuple] avoid some unnecessary value copies
jblomer May 28, 2026
d089da8
[core] remove unnecessary declaration in RResult
jblomer May 28, 2026
90369e4
[ntuple] mark some move constructors noexcept
jblomer May 28, 2026
17e3aaf
[core] make moving TTaskGroup noexcept
jblomer May 28, 2026
97318e7
[RVec] improve noexcept specification
jblomer May 28, 2026
c2e0f6f
[ntuple] fix virtual destructor visibility
jblomer May 28, 2026
24c8940
[ntuple] fix up RNTupleDescriptorBuilder::SetNTuple() signature
jblomer May 28, 2026
b3530e6
[ntuple] remove duplicate includes
jblomer May 28, 2026
fd00f3a
[core] minor improvement in TIterator
jblomer May 28, 2026
e299cd1
[NFC][ntuple] suppress cling-tidy warning for RKeyBlob
jblomer Jun 8, 2026
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
2 changes: 1 addition & 1 deletion core/base/inc/TBuffer.h
Original file line number Diff line number Diff line change
Expand Up @@ -390,7 +390,7 @@ template <class Tmpl> TBuffer &operator>>(TBuffer &buf, Tmpl *&obj)
// since the pointer could be zero (so typeid(*obj) is not usable).

auto cl = TClass::GetClass<Tmpl>();
obj = (Tmpl *) ( (void*) buf.ReadObjectAny(cl) );
obj = reinterpret_cast<Tmpl *>(buf.ReadObjectAny(cl));
return buf;
}

Expand Down
3 changes: 1 addition & 2 deletions core/cont/inc/TCollection.h
Original file line number Diff line number Diff line change
Expand Up @@ -267,8 +267,7 @@ class TIter {
}
TIter &operator=(TIterator *iter)
{
if (fIterator)
delete fIterator;
delete fIterator;
fIterator = iter;
return *this;
}
Expand Down
51 changes: 37 additions & 14 deletions core/foundation/inc/ROOT/RError.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,9 @@ private:

public:
/// Used by R__FAIL
RError(std::string_view message, RLocation &&sourceLocation);
RError(std::string_view message, const RLocation &sourceLocation);
/// Used by R__FORWARD_RESULT
void AddFrame(RLocation &&sourceLocation);
void AddFrame(const RLocation &sourceLocation);
/// Add more information to the diagnostics
void AppendToMessage(std::string_view info) { fMessage += info; }
/// Format a dignostics report, e.g. for an exception message
Expand All @@ -76,11 +76,36 @@ public:
*/
// clang-format on
class RException : public std::runtime_error {
RError fError;
std::optional<RError> fError;

public:
explicit RException(const RError &error) : std::runtime_error(error.GetReport()), fError(error) {}
const RError &GetError() const { return fError; }
RException(const RException &other) noexcept : std::runtime_error(other)
{
// A copy constructor of an exception should not throw; otherwise, during `throw RException(...)`,
// a second exception may be thrown that would immediately terminate the program.
// The fError member may throw due to the memory allocation in its string and vector members.
Comment thread
silverweed marked this conversation as resolved.
try {
fError = other.fError;
Comment thread
jblomer marked this conversation as resolved.
} catch (...) {
// OOM? Leave fError unset.
(void)fError;
}
}
RException(RException &&other) = default;
RException &operator=(RException &&other) = default;
RException &operator=(const RException &other) = default;

const RError &GetError() const
{
if (!fError) {
static const RError gOomError = RError("invalid fError in exception, possibly out of memory'",
{R__LOG_PRETTY_FUNCTION, __FILE__, __LINE__});

return gOomError;
}
return *fError;
}
};

// clang-format off
Expand Down Expand Up @@ -125,12 +150,12 @@ public:

/// Used by R__FORWARD_ERROR in order to keep track of the stack trace.
[[nodiscard]]
static RError ForwardError(RResultBase &&result, RError::RLocation &&sourceLocation)
static RError ForwardError(const RResultBase &result, const RError::RLocation &sourceLocation)
{
if (!result.fError) {
return RError("internal error: attempt to forward error of successful operation", std::move(sourceLocation));
return RError("internal error: attempt to forward error of successful operation", sourceLocation);
}
result.fError->AddFrame(std::move(sourceLocation));
result.fError->AddFrame(sourceLocation);
return *result.fError;
}
}; // class RResultBase
Expand Down Expand Up @@ -224,13 +249,11 @@ public:
RResult &operator=(const RResult &other) = delete;
RResult &operator=(RResult &&other) = default;

~RResult() = default;

/// Used by R__FORWARD_RESULT in order to keep track of the stack trace in case of errors
RResult &Forward(RError::RLocation &&sourceLocation)
RResult &Forward(const RError::RLocation &sourceLocation)
{
if (fError)
fError->AddFrame(std::move(sourceLocation));
fError->AddFrame(sourceLocation);
return *this;
}

Expand Down Expand Up @@ -277,10 +300,10 @@ public:
~RResult() = default;

/// Used by R__FORWARD_RESULT in order to keep track of the stack trace in case of errors
RResult &Forward(RError::RLocation &&sourceLocation)
RResult &Forward(const RError::RLocation &sourceLocation)
{
if (fError)
fError->AddFrame(std::move(sourceLocation));
fError->AddFrame(sourceLocation);
return *this;
}

Expand All @@ -300,7 +323,7 @@ public:
/// Short-hand to return an RResult<T> value from a subroutine to the calling stack frame
#define R__FORWARD_RESULT(res) std::move(res.Forward({R__LOG_PRETTY_FUNCTION, __FILE__, __LINE__}))
/// Short-hand to return an RResult<T> in an error state (i.e. after checking)
#define R__FORWARD_ERROR(res) res.ForwardError(std::move(res), {R__LOG_PRETTY_FUNCTION, __FILE__, __LINE__})
#define R__FORWARD_ERROR(res) res.ForwardError(res, {R__LOG_PRETTY_FUNCTION, __FILE__, __LINE__})

} // namespace ROOT

Expand Down
6 changes: 4 additions & 2 deletions core/foundation/inc/RtypesCore.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ class TRootIOCtor;

//---- types -------------------------------------------------------------------

// clang-format off
typedef char Char_t; ///< Character 1 byte (char) \warning Can be signed (most common) or unsigned depending on platform and compiler flags. \deprecated Consider replacing with `char`, `signed char` or `std::int8_t`
typedef unsigned char UChar_t; ///< Unsigned Character 1 byte (unsigned char) \deprecated Consider replacing with `unsigned char` or `std::uint8_t`
typedef short Short_t; ///< Signed Short integer 2 bytes (short) \deprecated Consider replacing with `short` or `std::int16_t`
Expand All @@ -64,7 +65,7 @@ typedef int Seek_t; ///< File pointer (int).
typedef long Long_t; ///< Signed long integer 8 bytes (long). Size depends on architecture \deprecated Consider replacing with `long`
typedef unsigned long ULong_t; ///< Unsigned long integer 8 bytes (unsigned long). Size depends on architecture \deprecated Consider replacing with `unsigned long`
#else
typedef int Seek_t; ///< File pointer (int).
typedef int Seek_t; ///< File pointer (int).
typedef long Long_t; ///< Signed long integer 4 bytes (long). Size depends on architecture \deprecated Consider replacing with `long`
typedef unsigned long ULong_t; ///< Unsigned long integer 4 bytes (unsigned long). Size depends on architecture \deprecated Consider replacing with `unsigned long`
#endif
Expand Down Expand Up @@ -119,7 +120,7 @@ constexpr UInt_t kMaxUInt = UInt_t(~0); ///< \deprecated Consider replaci
constexpr Int_t kMaxInt = Int_t(kMaxUInt >> 1);///< \deprecated Consider replacing with `std::numeric_limits<int>::max()` (or `std::int32_t`)
constexpr Int_t kMinInt = -kMaxInt - 1; ///< \deprecated Consider replacing with `std::numeric_limits<int>::lowest()` (or `std::int32_t`)

constexpr ULong_t kMaxULong = ULong_t(~0); ///< \deprecated Consider replacing with `std::numeric_limits<unsigned long>::max()`
constexpr ULong_t kMaxULong = ULong_t(-1); ///< \deprecated Consider replacing with `std::numeric_limits<unsigned long>::max()`
constexpr Long_t kMaxLong = Long_t(kMaxULong >> 1);///< \deprecated Consider replacing with `std::numeric_limits<long>::max()`
constexpr Long_t kMinLong = -kMaxLong - 1; ///< \deprecated Consider replacing with `std::numeric_limits<long>::lowest()`

Expand All @@ -129,6 +130,7 @@ constexpr Long64_t kMinLong64 = -kMaxLong64 - 1; ///< \deprecated Cons

constexpr ULong_t kBitsPerByte = 8; ///< \deprecated Consider replacing with `std::numeric_limits<unsigned char>::digits`.
constexpr Ssiz_t kNPOS = ~(Ssiz_t)0;///< The equivalent of `std::string::npos` for the ROOT class TString. \note Consider using std::string instead of TString whenever possible
// clang-format on

//---- debug global ------------------------------------------------------------

Expand Down
8 changes: 0 additions & 8 deletions core/foundation/inc/TClassEdit.h
Original file line number Diff line number Diff line change
Expand Up @@ -236,14 +236,6 @@ namespace TClassEdit {
{
return 0 == name.compare(0, 17, "std::__pair_base<") || 0 == name.compare(0, 12, "__pair_base<");
}
inline std::string GetUniquePtrType(std::string_view name)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TClassEdit is a public interface and thus this 'could' be used outside of ROOT. Should we deprecated it instead of removing it?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note that the function as is returns a temporary, so it may crash if actually used. No one complained so far.

I can still deprecate it but I'd have a preference for removing. Let me know if you'd prefer a slower removal.

{
// Find the first template parameter
std::vector<std::string> v;
int i;
GetSplit(name.data(), v, i);
return v[1];
}
std::string GetNameForIO(const std::string& templateInstanceName,
TClassEdit::EModType mode = TClassEdit::kNone,
bool* hasChanged = nullptr);
Expand Down
6 changes: 3 additions & 3 deletions core/foundation/src/RError.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -28,15 +28,15 @@ std::string ROOT::RError::GetReport() const
return report;
}

ROOT::RError::RError(std::string_view message, RLocation &&sourceLocation) : fMessage(message)
ROOT::RError::RError(std::string_view message, const RLocation &sourceLocation) : fMessage(message)

{
// Avoid frequent reallocations as we move up the call stack
fStackTrace.reserve(32);
AddFrame(std::move(sourceLocation));
AddFrame(sourceLocation);
}

void ROOT::RError::AddFrame(RLocation &&sourceLocation)
void ROOT::RError::AddFrame(const RLocation &sourceLocation)
{
fStackTrace.emplace_back(sourceLocation);
}
Expand Down
4 changes: 2 additions & 2 deletions core/imt/inc/ROOT/TTaskGroup.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,9 @@ private:

public:
TTaskGroup();
TTaskGroup(TTaskGroup &&other);
TTaskGroup(TTaskGroup &&other) noexcept;
TTaskGroup(const TTaskGroup &) = delete;
TTaskGroup &operator=(TTaskGroup &&other);
TTaskGroup &operator=(TTaskGroup &&other) noexcept;
~TTaskGroup();

void Cancel();
Expand Down
4 changes: 2 additions & 2 deletions core/imt/src/TTaskGroup.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -66,12 +66,12 @@ TTaskGroup::TTaskGroup()
#endif
}

TTaskGroup::TTaskGroup(TTaskGroup &&other)
TTaskGroup::TTaskGroup(TTaskGroup &&other) noexcept
{
*this = std::move(other);
}

TTaskGroup &TTaskGroup::operator=(TTaskGroup &&other)
TTaskGroup &TTaskGroup::operator=(TTaskGroup &&other) noexcept
{
fTaskArenaW = other.fTaskArenaW;
fTaskContainer = other.fTaskContainer;
Expand Down
Loading
Loading