Re: GC and multiple inheritance as in C++
"Juro Jon" <[email protected]> Fri, 13 Jun 2008 11:36:22 +1000
| Newsgroups | gmane.comp.gnome.mono.garbage-collection |
|---|---|
| Message-ID | <[email protected]> |
--===============0725268533== Content-Type: multipart/alternative; boundary="----=_Part_2674_12939764.1213320982831" ------=_Part_2674_12939764.1213320982831 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline 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 <[email protected]> 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) ? > ------=_Part_2674_12939764.1213320982831 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline 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?<br> <br>Thanks<br><br><div class="gmail_quote">On Fri, Jun 13, 2008 at 3:50 AM, David Jeske <<a href="mailto:[email protected]">[email protected]</a>> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"> AFAIK, you don't need C++ MI to have a pointer to something inside an object<br> body. This can happen if you take a ref of any instance data in C#.<br> <br> <a href="http://www.java2s.com/Code/CSharp/Language-Basics/CRefandOutParameters.htm" target="_blank">http://www.java2s.com/Code/CSharp/Language-Basics/CRefandOutParameters.htm</a><br> <div><div></div><div class="Wj3C7c"><br> -- Juro Jon wrote:<br> > Hello, I have a question concerning implementation of multiple inheritance in<br> > CIL. For a C++ MI object, a pointer can points to inside the object body<br> > instead of the its head. eg.<br> > struct A : B, C { }; C* c = new A;<br> > While Boehm GC detects this kind of reference, is it a supported feature of<br> > Mono? If not, what is the suggested way to implement it (eg. what is the<br> > C++/CLI way) ?<br> </div></div></blockquote></div><br> ------=_Part_2674_12939764.1213320982831-- --===============0725268533== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Mono-gc-list maillist - [email protected] http://lists.ximian.com/mailman/listinfo/mono-gc-list --===============0725268533==--