[Gc] RE: Abuse of collector...
aph at redhat.com
Mon May 18 09:54:53 PDT 2009
Talbot, George wrote:
> Talbot, George wrote:
>> Wow. That's really impressive. Somehow it seems better if the compiler could do that...I'd be afraid of getting it wrong.
> The runtime type information is precise, so it can't get the descriptor
> Also, the compiler *does* do that. _Jv_BuildGCDescr is only used when
> we generate classes on the fly, which we can do as well as precompiling.
> Sorry, I spoke incorrectly. What I meant was that for a C++ program, I'd be afraid of getting the layout wrong if I wrote code to do it myself, and would like to have the compiler generate the descriptor for C++ classes too.
I can't tell from http://www.codesourcery.com/public/cxx-abi/abi.html#rtti
(the multi-vendor C++ ABI) whether there's enough information to get what
you need. I think there isn't.
A paper at http://www.garret.ru/cppreflection/docs/reflect.html provides
some ideas, including a way to get typeinfo out of debug information.
More information about the Gc