aboutsummaryrefslogtreecommitdiff
path: root/libphobos/libdruntime/rt
diff options
context:
space:
mode:
Diffstat (limited to 'libphobos/libdruntime/rt')
-rw-r--r--libphobos/libdruntime/rt/deh.d2
-rw-r--r--libphobos/libdruntime/rt/dmain2.d10
2 files changed, 11 insertions, 1 deletions
diff --git a/libphobos/libdruntime/rt/deh.d b/libphobos/libdruntime/rt/deh.d
index 695f2ce..0a44be3 100644
--- a/libphobos/libdruntime/rt/deh.d
+++ b/libphobos/libdruntime/rt/deh.d
@@ -42,12 +42,14 @@ module rt.deh;
extern (C)
{
Throwable.TraceInfo _d_traceContext(void* ptr = null);
+ Throwable.TraceDeallocator rt_getTraceDeallocator();
void _d_createTrace(Throwable t, void* context)
{
if (t !is null && t.info is null &&
cast(byte*) t !is typeid(t).initializer.ptr)
{
t.info = _d_traceContext(context);
+ t.infoDeallocator = rt_getTraceDeallocator();
}
}
}
diff --git a/libphobos/libdruntime/rt/dmain2.d b/libphobos/libdruntime/rt/dmain2.d
index 264fdf6..8a10aac 100644
--- a/libphobos/libdruntime/rt/dmain2.d
+++ b/libphobos/libdruntime/rt/dmain2.d
@@ -182,6 +182,7 @@ extern (C) int rt_term()
*/
alias Throwable.TraceInfo function(void* ptr) TraceHandler;
private __gshared TraceHandler traceHandler = null;
+private __gshared Throwable.TraceDeallocator traceDeallocator = null;
/**
@@ -189,10 +190,12 @@ private __gshared TraceHandler traceHandler = null;
*
* Params:
* h = The new trace handler. Set to null to use the default handler.
+ * d = The new dealloactor to use.
*/
-extern (C) void rt_setTraceHandler(TraceHandler h)
+extern (C) void rt_setTraceHandler(TraceHandler h, Throwable.TraceDeallocator d = null)
{
traceHandler = h;
+ traceDeallocator = d;
}
/**
@@ -203,6 +206,11 @@ extern (C) TraceHandler rt_getTraceHandler()
return traceHandler;
}
+extern (C) Throwable.TraceDeallocator rt_getTraceDeallocator()
+{
+ return traceDeallocator;
+}
+
/**
* This function will be called when an exception is constructed. The
* user-supplied trace handler will be called if one has been supplied,