[D-runtime] druntime should be a shared library/DLL

Rainer Schuetze r.sagitario at gmx.de
Fri Feb 8 23:19:57 PST 2013


On 08.02.2013 19:05, Walter Bright wrote:>
 > On 2/7/2013 11:18 PM, Rainer Schuetze wrote:
 >> BTW: it's probably not a good idea to have multiple versions of phobos
 >> in different DLLs, because it also contains classes that you might
 >> want to share, like files and streams. Also, you'd get multiple
 >> instances of objects like moduleinfo and typeinfo, that are often
 >> compared by pointer identity.
 >
 > You're going to get those multiple instances regardless of whether
 > Phobos is a dll or not, because there'll be other dlls. The only
 > reasonable solution is to compare the typeinfo strings, too.

My idea was that different packages would go into different DLLs, so 
every module would only exist in one DLL. But I agree, that's probably 
not realistic (especially when considering template classes), so we'll 
have to deal with multiple instances of the same module (and different 
versions of it) anyway.

But how? What are the issues that can be expected?

The module info array comes to mind: sometimes you need just the DLL 
local array (e.g. when initializing modules), sometimes you need the 
whole array over all DLLs (e.g. for the object factory). Should it be 
possible to distinguish identically named modules in different DLLs?


More information about the D-runtime mailing list