« Return to Thread: GC and multiple inheritance as in C++

Re: GC and multiple inheritance as in C++

by Juro Jon :: Rate this Message:

Reply to Author | View in Thread

I don't know much of CLI specification so I may be missing something trivial. Java GC assumes that all pointers point to some "header" to identity the memory object. Since Java is single inheritance a pointer always points to the head of a full object, but for C++ multiple inheritance it may be pointing to an embedded part and need to be adjusted to find the full object. Are you saying that the CLI GC or typesystem has some way to do this adjustment?

Thanks

On Fri, Jun 13, 2008 at 3:50 AM, David Jeske <jeske@...> wrote:
AFAIK, you don't need C++ MI to have a pointer to something inside an object
body. This can happen if you take a ref of any instance data in C#.

http://www.java2s.com/Code/CSharp/Language-Basics/CRefandOutParameters.htm

-- Juro Jon wrote:
> Hello, I have a question concerning implementation of multiple inheritance in
> CIL. For a C++ MI object, a pointer can points to inside the object body
> instead of the its head. eg.
> struct A : B, C { };  C* c = new A;
> While Boehm GC detects this kind of reference, is it a supported feature of
> Mono? If not, what is the suggested way to implement it (eg. what is the
> C++/CLI way) ?


_______________________________________________
Mono-gc-list maillist  -  Mono-gc-list@...
http://lists.ximian.com/mailman/listinfo/mono-gc-list

 « Return to Thread: GC and multiple inheritance as in C++