 |
- Timestamp:
- 01/31/08 15:04:34
(10 months ago)
- Author:
- sean
- Message:
* Moved exception trace generation from tango.core.Exception into the runtime. This involved adding a TraceInfo? interface to the global Exception class, and moving the machinery to generate a trace into genobj.d.
* The new hook to attach a trace hander is as follows:
extern (C) void rt_setTraceHandler( void function( void* ptr = null ) h );
This feature is exposed in tango.core.Runtime as the new 'traceHandler' property.
* The change to tracing inspired me to similarly rewire the collection handler code to move that hook into the runtime as well. This was done to improve efficiency for collections, as each collected object can now simply test a pointer to see if a handler is set rather than calling into user-space to perform the same check. The new hook for this mechanism is:
extern (C) void rt_setCollectHandler( void function(Object) h );
And the feature is also exposed in the Runtime object as the new collectHandler property. I thought about the name 'collectHandler' being in Runtime rather than GC, but I think the accompanying explanation for the function justifies the decision.
-
Files:
-
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
| r3028 |
r3145 |
|
| 156 | 156 | class Exception : Object |
|---|
| 157 | 157 | { |
|---|
| | 158 | interface TraceInfo |
|---|
| | 159 | { |
|---|
| | 160 | int opApply( int delegate( inout char[] ) ); |
|---|
| | 161 | char[] toString(); |
|---|
| | 162 | } |
|---|
| | 163 | |
|---|
| 158 | 164 | char[] msg; |
|---|
| 159 | 165 | char[] file; |
|---|
| 160 | 166 | size_t line; |
|---|
| | 167 | TraceInfo info; |
|---|
| 161 | 168 | Exception next; |
|---|
| 162 | 169 | |
|---|
Download in other formats:
|
 |
 |
|
 |
Copyright © 2006-2008 Tango. All Rights Reserved. | Page Width:
Static or
Dynamic