Skip to content
Snippets Groups Projects
Commit 7b3b0795 authored by Rene Brun's avatar Rene Brun
Browse files

From Philippe:

I finally got some time to look at why CINT dictionary kept using __malloc_alloc_template with gcc 2.9x.  The reasons I was
looking
into it is that I have been having to filter out the word
'__malloc_alloc_template' when creating the Shadow (this was leading
to compiler error).  And today, I discovered that, more subtely, it
was making most multiple inheritances from a std container wrong.

The content of G__cpp_setup_inheritancedict was something like:

     DerivedTemplate<int> *G__Lderived;
     list<int,__malloc_alloc_template> *G__Lpbase=(list<int,__malloc_alloc_template>*)G__Lderived;
        ... (long)G__Lpbase-(long)G__Lderived ...

with DerivedTemplate inheriting from list.  And the result of the substraction was 0!

So I investigated further and discovered that gcc 2.9x uses __malloc_alloc_template
if and ONLY if the symbol __USE_MALLOC was set.  In the other case it uses
__default_alloc_template.

This means that in my example DerivedTemplate inherited from
list<int,__default_alloc_template> and NOT from list<int,__malloc_alloc_template>.
Hence the error.

The simple solution was to use neither of the 2 alloc_template but to use/rely on the typedef that gcc uses.  So for
makecint/rootcint ONLY, I modified CINT's memory header (see attachement).

This actually should fix ALL the problems we encountered related to __malloc_alloc_template.


git-svn-id: http://root.cern.ch/svn/root/trunk@5920 27541ba8-7e3a-0410-8455-c3a389f83636
parent c48a1308
Branches
Tags
No related merge requests found
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment