Skip to content

Commit 885f558

Browse files
committed
[meta] Add Root.TClass.GetClass.AutoParsing rootrc key.
This allows to disable auto-parsing during `TClass::GetClass` for debugging purposes.
1 parent 3067cfe commit 885f558

File tree

2 files changed

+10
-5
lines changed

2 files changed

+10
-5
lines changed

Diff for: config/rootrc.in

+8
Original file line numberDiff line numberDiff line change
@@ -644,3 +644,11 @@ Rint.Canvas.HighLightColor: 5
644644
# 1 All Branches (default)
645645
# Can be overridden by the environment variable ROOT_TTREECACHE_PREFILL
646646
# TTreeCache.Prefill: 1
647+
648+
# Advanced Debug Settings
649+
# Setting Root.TClass.GetClass.AutoParsing to false
650+
# will disable any auto-parsing execution of `TClass::GetClass`. This will
651+
# result in not being able to find TClass-es when the name requires not-already
652+
# loaded interpreted information (eg. a typedef to be resolved).
653+
#
654+
# Root.TClass.GetClass.AutoParsing: true

Diff for: core/meta/src/TClass.cxx

+2-5
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ In order to access the name of a class within the ROOT type system, the method T
5555
#include "TDataType.h"
5656
#include "TDatime.h"
5757
#include "TEnum.h"
58+
#include "TEnv.h"
5859
#include "TError.h"
5960
#include "TExMap.h"
6061
#include "TFunctionTemplate.h"
@@ -3158,11 +3159,7 @@ TClass *TClass::GetClass(const char *name, Bool_t load, Bool_t silent, size_t hi
31583159
#ifdef ROOT_DISABLE_TCLASS_GET_CLASS_AUTOPARSING
31593160
constexpr bool requestDisableAutoLoading = true;
31603161
#else
3161-
// We could get the user choice from:
3162-
// - environment variable ROOT_DISABLE_TCLASS_GET_CLASS_AUTOPARSING
3163-
// - rootrc key Root.TClass.GetClass.AutoParsing
3164-
// - TClass::SetGetClassAutoParsing
3165-
constexpr bool requestDisableAutoLoading = false;
3162+
static const bool requestDisableAutoLoading = !gEnv->GetValue("Root.TClass.GetClass.AutoParsing", true);
31663163
#endif
31673164
if (requestDisableAutoLoading)
31683165
disableAutoParsing = true;

0 commit comments

Comments
 (0)