Thread overview
[Issue 3568] New: BitArray Indexing Should Use ulong
Dec 03, 2009
David Simcha
Dec 03, 2009
David Simcha
Dec 22, 2009
Stewart Gordon
Dec 23, 2009
Leandro Lucarella
December 03, 2009
http://d.puremagic.com/issues/show_bug.cgi?id=3568

           Summary: BitArray Indexing Should Use ulong
           Product: D
           Version: 2.036
          Platform: Other
        OS/Version: Windows
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Phobos
        AssignedTo: nobody@puremagic.com
        ReportedBy: dsimcha@yahoo.com


--- Comment #0 from David Simcha <dsimcha@yahoo.com> 2009-12-03 12:42:15 PST ---
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.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
December 03, 2009
http://d.puremagic.com/issues/show_bug.cgi?id=3568



--- Comment #1 from Steven Schveighoffer <schveiguy@yahoo.com> 2009-12-03 13:07:06 PST ---
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.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
December 03, 2009
http://d.puremagic.com/issues/show_bug.cgi?id=3568



--- Comment #2 from David Simcha <dsimcha@yahoo.com> 2009-12-03 14:16:17 PST ---
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.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
December 22, 2009
http://d.puremagic.com/issues/show_bug.cgi?id=3568


Stewart Gordon <smjg@iname.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |smjg@iname.com


--- Comment #3 from Stewart Gordon <smjg@iname.com> 2009-12-22 04:07:48 PST ---
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....

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
December 22, 2009
http://d.puremagic.com/issues/show_bug.cgi?id=3568


Steven Schveighoffer <schveiguy@yahoo.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |schveiguy@yahoo.com


--- Comment #4 from Steven Schveighoffer <schveiguy@yahoo.com> 2009-12-22 05:38:05 PST ---
Like hard drives, I assert that 1MB == 1,000,000 bytes :)

2^32 bits / 8 bits per byte = 536870912 == 512 * 1024 * 1024

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
December 23, 2009
http://d.puremagic.com/issues/show_bug.cgi?id=3568


Leandro Lucarella <llucax@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |llucax@gmail.com


--- Comment #5 from Leandro Lucarella <llucax@gmail.com> 2009-12-22 17:12:09 PST ---
Yeap, the correct term for 1024 * 1024 is MiB (mibibyte):
http://en.wikipedia.org/wiki/Mebibyte :)

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------