On Saturday, 15 February 2020 at 14:30:20 UTC, Steven Schveighoffer wrote:
On 2/15/20 6:49 AM, Ferhat Kurtulmuş wrote:
On Friday, 14 February 2020 at 23:41:45 UTC, Steven

I'll note that you are going to leak some memory because you are not freeing deleted buckets when you resize. In the GC version, the GC takes care of those.

-Steve

I appreciate it for reviewing the code and your comments. Speed is good now. I put it on the dub db. I hope I am not violating any copyright. I included name of the original author (Martin Nowak) in the code, and explicitly stated that "betterC port of druntime/blob/master/src/rt/aaA.d".

What do you think about this one? I am not free-ing deleted entry in remove method:
https://github.com/aferust/bcaa/blob/a37b4ee4455477abc82425f32e9cf45394f4c4a1/source/bcaa.d#L228-L230

but here in resize:
https://github.com/aferust/bcaa/blob/a37b4ee4455477abc82425f32e9cf45394f4c4a1/source/bcaa.d#L190-L194

Thus, deleted buckets will wait until a resize call to free them. I think this is better for speed.

Reply via email to