digitalmars.D - Array!bool and size_t
- Nicolas Sicard (7/7) May 15 2012 The implementation of std.container.Array!bool makes use of ulong
- Dmitry Olshansky (6/13) May 15 2012 theoretically you can pack 8*2^30+ bits in 1Gb+ of memory. While it's
- Nicolas Sicard (8/26) May 15 2012 Yes, I understand this limitation. But from another theoretical
The implementation of std.container.Array!bool makes use of ulong instead of size_t as far as sizes and indices are concerned. This makes Array!bool inconsistent with other array-like types (including Array!T if !is(T==bool)) in 32-bit code. What would be the disadvantages of using size_t? Thanks, Nicolas
May 15 2012
On 15.05.2012 13:44, Nicolas Sicard wrote:The implementation of std.container.Array!bool makes use of ulong instead of size_t as far as sizes and indices are concerned. This makes Array!bool inconsistent with other array-like types (including Array!T if !is(T==bool)) in 32-bit code. What would be the disadvantages of using size_t? Thanks, Nicolastheoretically you can pack 8*2^30+ bits in 1Gb+ of memory. While it's doubtful if you can always fetch such big piece of contiguous memory from OS it's still possible. And 32bit bit-indexes just fail to address it. -- Dmitry Olshansky
May 15 2012
On Tuesday, 15 May 2012 at 10:04:52 UTC, Dmitry Olshansky wrote:On 15.05.2012 13:44, Nicolas Sicard wrote:Yes, I understand this limitation. But from another theoretical point of view, length not returning a size_t is odd for a container (std.bitmanip.BitArray.length did). But I am ok if it is more needful for an array of bool to be able to address the full memory... Thanks, NicolasThe implementation of std.container.Array!bool makes use of ulong instead of size_t as far as sizes and indices are concerned. This makes Array!bool inconsistent with other array-like types (including Array!T if !is(T==bool)) in 32-bit code. What would be the disadvantages of using size_t? Thanks, Nicolastheoretically you can pack 8*2^30+ bits in 1Gb+ of memory. While it's doubtful if you can always fetch such big piece of contiguous memory from OS it's still possible. And 32bit bit-indexes just fail to address it.
May 15 2012