Bug 3568 – BitArray Indexing Should Use ulong

Status
RESOLVED
Resolution
WONTFIX
Severity
normal
Priority
P2
Component
phobos
Product
D
Version
D2
Platform
Other
OS
All
Creation time
2009-12-03T12:42:00Z
Last change time
2014-06-17T21:31:55Z
Assigned to
nobody
Creator
dsimcha

Comments

Comment #0 by dsimcha — 2009-12-03T12:42:15Z
Given that the whole point of a BitArray is space efficiency so that you can pack more into less memory, it seems silly to me that BitArrays are indexed by size_t, thus arbitrarily preventing you from using more than 2^32 elements on 32-bit architectures.
Comment #1 by schveiguy — 2009-12-03T13:07:06Z
2^32 bits takes up 536MB. Do you need a bit array greater than that size? It seems a bit excessive to allow larger arrays, making compiled code more complex for indexing. Perhaps the index type can be templated if you want a larger one.
Comment #2 by dsimcha — 2009-12-03T14:16:17Z
Yes, I'm within earshot of needing this. I'm working with adjacency matrices for graphs with ~50,000 vertices. It wouldn't take much more to hit this limit.
Comment #3 by smjg — 2009-12-22T04:07:48Z
Where do you get 536MB from? It's 512MB. Nice round figure in binary terms - it has to be. But you've got me wondering if there's a more efficient way of storing that kind of data....
Comment #4 by schveiguy — 2009-12-22T05:38:05Z
Like hard drives, I assert that 1MB == 1,000,000 bytes :) 2^32 bits / 8 bits per byte = 536870912 == 512 * 1024 * 1024
Comment #5 by leandro.lucarella — 2009-12-22T17:12:09Z
Yeap, the correct term for 1024 * 1024 is MiB (mibibyte): http://en.wikipedia.org/wiki/Mebibyte :)
Comment #6 by andrej.mitrovich — 2014-04-24T19:32:29Z
(In reply to Leandro Lucarella from comment #5) > Yeap, the correct term for 1024 * 1024 is MiB (mibibyte): > http://en.wikipedia.org/wiki/Mebibyte :) Or Men in Black's. On a more serious note, are we going forward with this?
Comment #7 by safety0ff.bugz — 2014-06-14T20:39:13Z
Comment #8 by safety0ff.bugz — 2014-06-17T21:29:56Z
Comment #9 by safety0ff.bugz — 2014-06-17T21:31:55Z