modifying the DMD compiler

Moritz mpipahl at gspgmbh.com
Sat Dec 13 08:16:10 PST 2008


Hello,

Im a student of computer science and at university, we're working on a 
distributed shared memory system, implemented as a C library.

Im also a great fan of D, and so Im asking myself if I could connect D 
to the C library (which is no problem, as far as I know) and then modify 
the memory allocation of the compiler to place objects into the 
distributed memory (I would also need to disable garbage collection, but 
that should be no problem).

Ive already reviewed the sourcecode of the dmd (the parts of it that are 
shipped with the dmd) and found out malloc() is called in Mem.c

So I guess a rather simple way to do what I need would be to overwrite 
the new() operator or to add another operator to allocate distributed 
memory (something like new_shared() maybe).

But there are a lot of questions, which I would like to ask here, before 
I start to code...

1. The most elegant way to modify the compiler would be to create a 
class "sharable" and all objects inheriting from it would be created in 
distributed memory, but I guess this way would be rather complicated, 
wouldnt it?

2. Is a modification like the one with new_shared() or those described 
in 1 possible with the DMD or do I have to modify the GDC?

3. Any hints whatsoever to make my task easier?

Thanks in advance for your help!



More information about the Digitalmars-d mailing list