digitalmars.D - Another bug in the GC
- Bill Baxter (36/36) Jan 27 2007 This bug seems to be related to pointers in mixins not getting treated
- renoX (6/6) Jan 26 2007 The joy of GCs.. :-(
- Bill Baxter (5/12) Jan 26 2007 Did Sun not have an equivalent of std.gc.fullCollect to force a GC cycle...
- renoX (5/21) Jan 27 2007 I think they have, but it's useful only when you have figured what's
This bug seems to be related to pointers in mixins not getting treated as pointers. (filed as bug 892 -- just posting here to make sure it gets noticed) ------------------------ import std.stdio; static import std.gc; class SomeObject { this() { writefln("SomeObject created"); } ~this() { writefln("SomeObject destroyed"); } } template Mix() { void init() { ptr = new SomeObject; } SomeObject ptr; } class Container { this() { init(); } mixin Mix; } void main() { auto x = new Container; writefln("---Pre collect"); std.gc.fullCollect(); writefln("---Post collect"); } ------------------------------------ With DMD 1.003 this outputs: SomeObject created ---Pre collect SomeObject destroyed ---Post collect
Jan 27 2007
The joy of GCs.. :-( I remember a bug in Sun's JVM: the GC wouldn't take into account static reference to object, freeing 'singleton' objects during the collection.. Took me some time to figure what was happening (especially since collection phase occur more or less randomly). renoX
Jan 26 2007
renoX wrote:The joy of GCs.. :-( I remember a bug in Sun's JVM: the GC wouldn't take into account static reference to object, freeing 'singleton' objects during the collection.. Took me some time to figure what was happening (especially since collection phase occur more or less randomly). renoXDid Sun not have an equivalent of std.gc.fullCollect to force a GC cycle? (sorry about my previous posts from the future -- forgot that I set my timezone to something bogus the other day.) --bb
Jan 26 2007
Bill Baxter a écrit :renoX wrote:I think they have, but it's useful only when you have figured what's happening to reproduce it, at the begining there are just weird exceptions at random time, and I didn't suspect the GC for some time.. renoXThe joy of GCs.. :-( I remember a bug in Sun's JVM: the GC wouldn't take into account static reference to object, freeing 'singleton' objects during the collection.. Took me some time to figure what was happening (especially since collection phase occur more or less randomly). renoXDid Sun not have an equivalent of std.gc.fullCollect to force a GC cycle?(sorry about my previous posts from the future -- forgot that I set my timezone to something bogus the other day.) --bb
Jan 27 2007