www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - OffsetTypeInfo

reply dsimcha <dsimcha yahoo.com> writes:
According to this post:
http://www.digitalmars.com/pnews/read.php?server=news.digitalmars.com&group=digitalmars.D&artnum=86918

OffsetTypeInfo can be enabled when building LDC.  Why does it not appear to
work in current versions of DMD?  Is there a good reason why it's apparently
disabled?  The reason I ask is because with OffsetTypeInfo enabled, one could
almost trivially build a mostly-precise GC.  All that would be needed is for
each block to store a pointer to typeinfo.
Mar 30 2009
parent Tomas Lindquist Olsen <tomas.l.olsen gmail.com> writes:
On Mon, Mar 30, 2009 at 5:48 PM, dsimcha <dsimcha yahoo.com> wrote:
 According to this post:
 http://www.digitalmars.com/pnews/read.php?server=3Dnews.digitalmars.com&g=
roup=3Ddigitalmars.D&artnum=3D86918
 OffsetTypeInfo can be enabled when building LDC. =C2=A0Why does it not ap=
pear to
 work in current versions of DMD? =C2=A0Is there a good reason why it's ap=
parently
 disabled? =C2=A0The reason I ask is because with OffsetTypeInfo enabled, =
one could
 almost trivially build a mostly-precise GC. =C2=A0All that would be neede=
d is for
 each block to store a pointer to typeinfo.
Last I check DMD just emits a null array, in codegen. I think I only realised this after implementing it in LDC. Anyway, Tango is currently set up in a way that will cause linking problems on some platforms when offTi is enabled, due to the extra typeinfo references. I don't recall the exact details, but that and that it adds some bloat as well (which is useless with .offTi is never used) are the reasons we disabled it by default. -Tomas
Mar 30 2009