How to tell if the GC is running?

Etienne etcimon at gmail.com
Sun Apr 6 16:20:23 PDT 2014


On 2014-04-06 5:20 PM, Tomer Filiba wrote:
> On Sunday, 6 April 2014 at 16:34:02 UTC, safety0ff wrote:
>> Please post more of the stack trace, it looks like you're allocating
>> while it is running the destructors / finalization (#11408.)
>>
>> https://d.puremagic.com/issues/show_bug.cgi?id=11408
>
> Yes, I know I'm allocating while the GC is collecting. I'm asking how to
> avoid this situation -- is there some way to tell that the GC is running?
>
> -tomer

If the GC is running you get a stack trace with fullcollect() like this:

cache-d_d.exe!gc at gc@Gcx at mark(void * this, void * nRecurse, int ptop) 
Line 2266    C++
      cache-d_d.exe!gc at gc@Gcx at mark(void * this, void * ptop) Line 2249 
   C++
      cache-d_d.exe!gc at gc@Gcx at fullcollect() Line 2454    C++
      cache-d_d.exe!gc at gc@GC at mallocNoSync(unsigned int this, unsigned 
int alloc_size, unsigned int * alloc_size) Line 458    C++
      cache-d_d.exe!gc at gc@GC at malloc(unsigned int this, unsigned int 
alloc_size, unsigned int * bits) Line 413    C++



More information about the Digitalmars-d mailing list