Skip to content

Commit 0ea22e3

Browse files
committed
[core] Do not load MathCore lib at the prompt if this is a module build
therewith saving runtime and memory.
1 parent d9b2ba5 commit 0ea22e3

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

core/rint/src/TRint.cxx

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -195,11 +195,16 @@ TRint::TRint(const char *appClassName, Int_t *argc, char **argv, void *options,
195195
PrintLogo(lite);
196196
}
197197

198-
// Explicitly load libMathCore it cannot be auto-loaded it when using one
199-
// of its freestanding functions. Once functions can trigger autoloading we
200-
// can get rid of this.
198+
#ifndef R__USE_CXXMODULES
199+
// When modules are not used, and therefore rootmaps, freestanding functions
200+
// cannot trigger autoloading. Therefore, given the widespread usage of the
201+
// freestanding functions in MathCore, we load the library explicitly.
202+
// When modules are used to condense the reflection information, this manual
203+
// loading is not needed, and it can be skipped in order to save time and
204+
// memory when starting the ROOT prompt.
201205
if (!gClassTable->GetDict("TRandom"))
202206
gSystem->Load("libMathCore");
207+
#endif
203208

204209
if (!gInterpreter->HasPCMForLibrary("std")) {
205210
// Load some frequently used includes

0 commit comments

Comments
 (0)