Re: Can I remove an element from a global associative array from within a class destructor?

2019-08-03 Thread JN via Digitalmars-d-learn
On Friday, 2 August 2019 at 23:13:10 UTC, realhet wrote: Today I read the documentation about structs, unions and classes, but I haven't find any restrictions for the ~this() destructors. Is there some extra rules regarding the GC and what I must not do in the destructors? Class destructors

Re: Can I remove an element from a global associative array from within a class destructor?

2019-08-03 Thread realhet via Digitalmars-d-learn
On Saturday, 3 August 2019 at 05:33:05 UTC, Jonathan M Davis wrote: On Friday, August 2, 2019 5:13:10 PM MDT realhet via Digitalmars-d-learn wrote: Hi, ... Thank you! Now I have 2 solutions in mind: 1. If I only want to track the count and totalBytes for a specific kind of reference, I will

Re: Can I remove an element from a global associative array from within a class destructor?

2019-08-02 Thread Jonathan M Davis via Digitalmars-d-learn
On Friday, August 2, 2019 5:13:10 PM MDT realhet via Digitalmars-d-learn wrote: > Hi, > > I tried to make some resource statistict for my OpenGL Buffer > objects: > > > //here are the things that hold the statistics. > private __gshared{ size_t[int] textureSizeMap, bufferSizeMap; } > > struct GLCo

Can I remove an element from a global associative array from within a class destructor?

2019-08-02 Thread realhet via Digitalmars-d-learn
Hi, I tried to make some resource statistict for my OpenGL Buffer objects: //here are the things that hold the statistics. private __gshared{ size_t[int] textureSizeMap, bufferSizeMap; } struct GLCounters{ int programs, shaders, textures, buffers; size_t textureSize, bufferSize; } __gsha