D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 3568 - BitArray Indexing Should Use ulong
Summary: BitArray Indexing Should Use ulong
Status: RESOLVED WONTFIX
Alias: None
Product: D
Classification: Unclassified
Component: phobos (show other issues)
Version: D2
Hardware: Other All
: P2 normal
Assignee: No Owner
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-12-03 12:42 UTC by David Simcha
Modified: 2014-06-17 21:31 UTC (History)
5 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description David Simcha 2009-12-03 12:42:15 UTC
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 Steven Schveighoffer 2009-12-03 13:07:06 UTC
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 David Simcha 2009-12-03 14:16:17 UTC
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 Stewart Gordon 2009-12-22 04:07:48 UTC
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 Steven Schveighoffer 2009-12-22 05:38:05 UTC
Like hard drives, I assert that 1MB == 1,000,000 bytes :)

2^32 bits / 8 bits per byte = 536870912 == 512 * 1024 * 1024
Comment 5 Leandro Lucarella 2009-12-22 17:12:09 UTC
Yeap, the correct term for 1024 * 1024 is MiB (mibibyte): http://en.wikipedia.org/wiki/Mebibyte :)
Comment 6 Andrej Mitrovic 2014-04-24 19:32:29 UTC
(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 safety0ff.bugz 2014-06-14 20:39:13 UTC
https://issues.dlang.org/show_bug.cgi?id=3568
Comment 9 safety0ff.bugz 2014-06-17 21:31:55 UTC
and: https://issues.dlang.org/show_bug.cgi?id=11349