Dynamic loading

David Nadlinger code at klickverbot.at
Mon Oct 28 14:49:02 PDT 2013


On Monday, 28 October 2013 at 20:44:11 UTC, Jacob Carlborg wrote:
>> That sounds a bit implausible. New language keyword or 
>> something to load
>> a library or object file. My best guess is that extern(C) 
>> dlopen() will
>> just work correctly, failing that I'd think we need an 
>> equivalent Phobos
>> call.
>
> It's not completely done yet but I think 
> core.runtime.Runtime.loadLibrary will be the function used to 
> load libraries. See: 
> https://github.com/D-Programming-Language/druntime/pull/617

In the current implementation, just loading a library using the C 
functions would indeed work, as the D runtime 
registration/initialization happens in a C .ctor. The actual 
implementation in druntime is a bit more complex, mainly to 
handle thread synchronization.

David


More information about the Digitalmars-d mailing list