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
3 changes: 2 additions & 1 deletion hist/histv7/inc/ROOT/RAxes.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
#include "RBinIndexMultiDimRange.hxx"
#include "RBinIndexRange.hxx"
#include "RCategoricalAxis.hxx"
#include "RHistUtils.hxx"
#include "RLinearizedIndex.hxx"
#include "RRegularAxis.hxx"
#include "RVariableBinAxis.hxx"
Expand Down Expand Up @@ -38,7 +39,7 @@ namespace Internal {
/**
Bin configurations for all dimensions of a histogram.
*/
class RAxes final {
class R__CLING_PTRCHECK(off) RAxes final {
template <typename T>
friend class ::ROOT::Experimental::RHistEngine;

Expand Down
2 changes: 1 addition & 1 deletion hist/histv7/inc/ROOT/RHistFillContext.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ A context to concurrently fill an RHist.
Feedback is welcome!
*/
template <typename BinContentType>
class RHistFillContext final {
class R__CLING_PTRCHECK(off) RHistFillContext final {
friend class RHistConcurrentFiller<BinContentType>;

private:
Expand Down
8 changes: 8 additions & 0 deletions hist/histv7/inc/ROOT/RHistUtils.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,14 @@
#include <intrin.h>
#endif

#ifdef __CLING__
// This attribute can significantly speed up JIT-compiled code in CLING
// It is also defined in ROOT, so keep the definitions the same.

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.

Wondering if we should give it a different name...

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I found it in the C standard, and it's covering the exact case where two (sometimes related, sometimes unrelated) include paths lead to the macro being redefined.

6.10.3 p2:

An identifier currently defined as an object-like macro shall not be redefined by another
#define preprocessing directive unless the second definition is an object-like macro
definition and the two replacement lists are identical. Likewise, an identifier currently
defined as a function-like macro shall not be redefined by another #define
preprocessing directive unless the second definition is a function-like macro definition
that has the same number and spelling of parameters, and the two replacement lists are
identical.

By the above, we are doing it standard-compliant as it's now.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

But indeed, we could define also an RHist-specific macro that expands to the same attribute. I don't see a downside of that, so I guess that should be the way forward.

#define R__CLING_PTRCHECK(ONOFF) __attribute__((annotate("__cling__ptrcheck(" #ONOFF ")")))
#else
#define R__CLING_PTRCHECK(ONOFF)
#endif

namespace ROOT {
namespace Experimental {
namespace Internal {
Expand Down
Loading