Program crashes in cling only when dictionaries are built

It’s always nice to find your own question when you Google for more info on a matter; in this case ClassDefInline: How to use ClassDefInline? - #7 by ahesam :wink:

The documentation on ClassDefInline is still a bit scarce. I can appreciate the fact that no dictionaries need to be generated (this would reduce the compile time of our library significantly).

To get I/O to work properly, without the dictionary, you still need to find an alternative way to inject the header information (which is now essential).

Could you explain a bit more what you mean by this? What alternative ways would you suggest? If I were to write a non-ROOT object to file using ROOT I/O, how would I, for example, be able to read this file in the interpreter / notebook? Would including the header (which uses ClassDefInline) be enough? At the moment I need to load the dictionary shared object first and then I can properly read back.

In earlier release notes [1] it was mentioned that it’s especially useful for “scripts and other non-framework code”. Is this still the case? Because my intention would be to replace the regular ClassDef in our codebase with ClassDefInline to get rid of generating dictionaries. What would be the effect on the performance? Would every I/O call incur an extra penalty as compared to have precompiled dictionaries? Are there any studies or benchmarks done on this matter?

To have Cling (and thus ACLiC) always use the USE_DICT macro, you place somewhere ‘central’:

This would be a convenient solution if it weren’t for the case where our library is compiled with USE_DICT off and users start loading it into cling where we would now force USE_DICT to be set and get again mismatches in memory layouts.

@Axel, @pcanal, the point on checking vtable entries in cling sounds indeed like something close to impossible. Although my point was not to have this check ‘on by default’, but to enable this in a kind of ‘cling debug mode’. Anyways, this is probably not a highly reoccurring issue I can imagine :wink:

I wish you both great holidays too!

Cheers,
Ahmad

[1] ROOT v6.10/00 has been released!