Re: rt/aaA.d Line: 553

2020-02-15 Thread Steven Schveighoffer via Digitalmars-d-learn
On 2/15/20 10:21 AM, Ferhat Kurtulmuş wrote: 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

Re: rt/aaA.d Line: 553

2020-02-15 Thread Ferhat Kurtulmuş via Digitalmars-d-learn
On Saturday, 15 February 2020 at 15:21:08 UTC, Ferhat Kurtulmuş wrote: 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 Ops I ve made commits. Here are the links up to

Re: rt/aaA.d Line: 553

2020-02-15 Thread Ferhat Kurtulmuş via Digitalmars-d-learn
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

Re: rt/aaA.d Line: 553

2020-02-15 Thread Steven Schveighoffer via Digitalmars-d-learn
On 2/15/20 6:49 AM, Ferhat Kurtulmuş wrote: On Friday, 14 February 2020 at 23:41:45 UTC, Steven Schveighoffer wrote: On 2/14/20 6:36 PM, Ferhat Kurtulmuş wrote: İf ((aa.used + 1)* GROW_DEN > aa.dim * GROW_NUM) aa.grow(ti.key); This call is expensive (it reallocates all the

Re: rt/aaA.d Line: 553

2020-02-15 Thread Ferhat Kurtulmuş via Digitalmars-d-learn
On Friday, 14 February 2020 at 23:41:45 UTC, Steven Schveighoffer wrote: On 2/14/20 6:36 PM, Ferhat Kurtulmuş wrote:     İf ((aa.used + 1)* GROW_DEN > aa.dim * GROW_NUM)     aa.grow(ti.key); This call is expensive (it reallocates all the buckets and reinserts all the existing data into

Re: rt/aaA.d Line: 553

2020-02-14 Thread Ferhat Kurtulmuş via Digitalmars-d-learn
On Friday, 14 February 2020 at 23:28:39 UTC, Steven Schveighoffer wrote: On 2/14/20 5:57 PM, Ferhat Kurtulmuş wrote: One thing to learn, you can select a section of lines from github (click on first line, then shift-click on last line), then press the 'y' key, and it will generate a

Re: rt/aaA.d Line: 553

2020-02-14 Thread Steven Schveighoffer via Digitalmars-d-learn
On 2/14/20 6:36 PM, Ferhat Kurtulmuş wrote:     İf ((aa.used + 1)* GROW_DEN > aa.dim * GROW_NUM)     aa.grow(ti.key); This call is expensive (it reallocates all the buckets and reinserts all the existing data into the new bucket), it should be avoided if in the end we will not be

Re: rt/aaA.d Line: 553

2020-02-14 Thread Ferhat Kurtulmuş via Digitalmars-d-learn
On Friday, 14 February 2020 at 23:19:31 UTC, Paul Backus wrote: On Friday, 14 February 2020 at 22:57:31 UTC, Ferhat Kurtulmuş wrote: findSlotInsert are called two times. Why not: if (++aa.used * GROW_DEN > aa.dim * GROW_NUM) aa.grow(ti.key); auto p = aa.findSlotInsert(hash);

Re: rt/aaA.d Line: 553

2020-02-14 Thread Steven Schveighoffer via Digitalmars-d-learn
On 2/14/20 5:57 PM, Ferhat Kurtulmuş wrote: I hesitated to post this on the topic of druntime because probably I will learn something new if I am totally/stupidly wrong. There are no stupid questions, and this is the learn forum. So you are in the right place! In

Re: rt/aaA.d Line: 553

2020-02-14 Thread Paul Backus via Digitalmars-d-learn
On Friday, 14 February 2020 at 22:57:31 UTC, Ferhat Kurtulmuş wrote: findSlotInsert are called two times. Why not: if (++aa.used * GROW_DEN > aa.dim * GROW_NUM) aa.grow(ti.key); auto p = aa.findSlotInsert(hash); // only one call is enough? if (p.deleted)

rt/aaA.d Line: 553

2020-02-14 Thread Ferhat Kurtulmuş via Digitalmars-d-learn
I hesitated to post this on the topic of druntime because probably I will learn something new if I am totally/stupidly wrong. In druntime/blob/master/src/rt/aaA.d Lines 553-562: ... auto p = aa.findSlotInsert(hash); if (p.deleted) --aa.deleted; // check load factor and