digitalmars.D - AA implementation question
- H. S. Teoh (8/8) Mar 07 2012 I'm playing around with writing an AA implementation that doesn't
- Martin Nowak (3/8) Mar 07 2012 It's used to avoid extra allocations when only very few buckets are need...
- H. S. Teoh (5/16) Mar 07 2012 Ah, that makes sense. Thanks!
- Andrej Mitrovic (3/3) Mar 08 2012 FWIW Steven's dcollections has a hash implementation, you could take a
- Andrej Mitrovic (1/1) Mar 08 2012 By hash I mean map/AA.
I'm playing around with writing an AA implementation that doesn't require typeinfos to work, using aaA.d as reference. One thing I don't quite understand: what's binit used for, and why is it necessary? It seems redundant to me, since D always initializes pointer arrays to nulls (right?). T -- There are three kinds of people in the world: those who can count, and those who can't.
Mar 07 2012
On Thu, 08 Mar 2012 06:12:20 +0100, H. S. Teoh <hsteoh quickfur.ath.cx> wrote:I'm playing around with writing an AA implementation that doesn't require typeinfos to work, using aaA.d as reference. One thing I don't quite understand: what's binit used for, and why is it necessary? It seems redundant to me, since D always initializes pointer arrays to nulls (right?).It's used to avoid extra allocations when only very few buckets are needed.
Mar 07 2012
On Thu, Mar 08, 2012 at 06:37:13AM +0100, Martin Nowak wrote:On Thu, 08 Mar 2012 06:12:20 +0100, H. S. Teoh <hsteoh quickfur.ath.cx> wrote:Ah, that makes sense. Thanks! T -- It's bad luck to be superstitious. -- YHLI'm playing around with writing an AA implementation that doesn't require typeinfos to work, using aaA.d as reference. One thing I don't quite understand: what's binit used for, and why is it necessary? It seems redundant to me, since D always initializes pointer arrays to nulls (right?).It's used to avoid extra allocations when only very few buckets are needed.
Mar 07 2012
FWIW Steven's dcollections has a hash implementation, you could take a look (it's Boost-licensed): http://www.dsource.org/projects/dcollections
Mar 08 2012