Rust-based provocation :)
Adam D. Ruppe
destructionator at gmail.com
Mon May 27 17:43:23 PDT 2013
On Monday, 27 May 2013 at 17:51:33 UTC, Dicebot wrote:
> Looking at object.d source, it looks like you are generating
> TypeInfo stubs that can be optimized away, have I understood it
> right?
I'm not sure if they can be optimized away, but all I was doing
is putting the bare minimum so the compiler would shut up.
> P.S. I can't get to run your "minimal.zip" example because of
> "object.d(87): Error: mismatch between compiler and object.d or
> object.di found." which does not really make sense in scope of
> line 87. Any ideas? Have changes all relevant stuff from x32 to
> x64 as far as I can see.
Hmm I already modified the file I have locally. I'll update the
zip but I don't think this will work in 64 bit anyway because the
syscall functions are all written in 32 bit inline asm. (I've
never written a 64 bit asm program so I'm not even sure what the
calling convention would look like there. If you ripped that out
and used C functions instead, with an extern(C) main even maybe,
you might be in business though.)
I think line 87 was one of the TypeInfos though, and dmd expects
them to be a particular size, and it is slightly different on 64
bit. If it is TypeInfo_Struct, on 32 bit void*[13] stuff; is good
enough for dmd to shut up.
I believe on 64 bit it expects two more words, so void*[15] stuff
should be good enough.
this should be updated and hitting "make" worked on my box,
building 32 bit, with the test program being a bit of class
stuff. The write() and exit() functions are moved to object.d
right now, along with a dead stupid "allocator" that gives you a
pointer to a static buffer (that it never frees) to play with new
class. If you are using libc, malloc/free should be able to do
the job instead, see the manual_alloc and manual_free stubs in
object.d
http://arsdnet.net/dcode/minimal.zip
More information about the Digitalmars-d
mailing list