comparison druntime/src/compiler/dmd/invariant_.d @ 759:d3eb054172f9

Added copy of druntime from DMD 2.020 modified for LDC.
author Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
date Tue, 11 Nov 2008 01:52:37 +0100
parents
children
comparison
equal deleted inserted replaced
758:f04dde6e882c 759:d3eb054172f9
1 /*
2 * Placed into the Public Domain
3 * written by Walter Bright
4 * www.digitalmars.com
5 */
6 module rt.invariant_;
7
8 extern (C) void _d_invariant(Object o)
9 { ClassInfo c;
10
11 //printf("__d_invariant(%p)\n", o);
12
13 // BUG: needs to be filename/line of caller, not library routine
14 assert(o !is null); // just do null check, not invariant check
15
16 c = o.classinfo;
17 do
18 {
19 if (c.classInvariant)
20 {
21 (*c.classInvariant)(o);
22 }
23 c = c.base;
24 } while (c);
25 }