private
{
+ import memory;
import util.console;
import core.stdc.stddef;
import core.stdc.stdlib;
*/
extern (C)
{
- void* gc_getHandle();
- void gc_setHandle(void* p);
- void gc_clrHandle();
+ void* gc_getProxy();
+ void gc_setProxy(void* p);
+ void gc_clrProxy();
alias void* function() gcGetFn;
alias void function(void*) gcSetFn;
alias void function() gcClrFn;
- alias bool function(ExceptionHandler dg = null) rtInitFn;
- alias bool function(ExceptionHandler dg = null) rtTermFn;
}
extern (C) void* rt_loadLibrary(in char[] name)
void* ptr = LoadLibraryA(temp.ptr);
if (ptr is null)
return ptr;
- gcSetFn gcSet = cast(gcSetFn) GetProcAddress(ptr, "_gc_setHandle");
- rtInitFn rtInit = cast(rtInitFn) GetProcAddress(ptr, "_rt_init");
- if (gcSet is null || rtInit is null)
- return ptr;
- gcSet(gc_getHandle());
- rtInit();
+ gcSetFn gcSet = cast(gcSetFn) GetProcAddress(ptr, "gc_setProxy");
+ if (gcSet !is null)
+ gcSet(gc_getProxy());
return ptr;
}
}
}
-extern (C) void rt_unloadLibrary(void* ptr)
+extern (C) bool rt_unloadLibrary(void* ptr)
{
version (Windows)
{
- gcClrFn gcClr = cast(gcClrFn) GetProcAddress(ptr, "_gc_clrHandle");
- rtTermFn rtTerm = cast(rtTermFn) GetProcAddress(ptr, "_rt_term");
-
- if (gcClr !is null && rtTerm !is null)
- {
- rtTerm();
+ gcClrFn gcClr = cast(gcClrFn) GetProcAddress(ptr, "gc_clrProxy");
+ if (gcClr !is null)
gcClr();
- }
return FreeLibrary(ptr) != 0;
}
else version (linux)
*/
extern (C) void onAssertError(string file, size_t line);
extern (C) void onAssertErrorMsg(string file, size_t line, string msg);
-extern (C) void onArrayBoundsError(string file, size_t line);
+extern (C) void onRangeError(string file, size_t line);
extern (C) void onHiddenFuncError(Object o);
extern (C) void onSwitchError(string file, size_t line);
extern (C) bool runModuleUnitTests();
extern (C) void _d_array_bounds(string file, uint line)
{
- onArrayBoundsError(file, line);
+ onRangeError(file, line);
}
extern (C) void _d_switch_error(string file, uint line)
try
{
gc_init();
+ initStaticDataGC();
version (Windows)
_minit();
_moduleCtor();
bool trapExceptions = rt_trapExceptions;
- void tryExec(void delegate() dg)
+ void tryExec(scope void delegate() dg)
{
if (trapExceptions)
void runAll()
{
gc_init();
+ initStaticDataGC();
version (Windows)
_minit();
_moduleCtor();