Thread overview | ||||||
---|---|---|---|---|---|---|
|
January 26, 2007 Another bug in the GC | ||||
---|---|---|---|---|
| ||||
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 |
January 26, 2007 Re: Another bug in the GC | ||||
---|---|---|---|---|
| ||||
Posted in reply to Bill Baxter | 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 |
January 26, 2007 Re: Another bug in the GC | ||||
---|---|---|---|---|
| ||||
Posted in reply to renoX | 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).
>
> renoX
Did 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
|
January 27, 2007 Re: Another bug in the GC | ||||
---|---|---|---|---|
| ||||
Posted in reply to Bill Baxter | Bill Baxter a écrit : > 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). >> >> renoX > > Did Sun not have an equivalent of std.gc.fullCollect to force a GC cycle? 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.. renoX > > (sorry about my previous posts from the future -- forgot that I set my timezone to something bogus the other day.) > > --bb |
Copyright © 1999-2021 by the D Language Foundation