Thread overview | |||||
---|---|---|---|---|---|
|
November 14, 2013 Maximum size of an string ? | ||||
---|---|---|---|---|
| ||||
Hi :) Has someone tested the maximum size of a D string variable for both 32 and 64 bits platforms ? Is it different from the maximum size of a char[] ? Oo` -- JC |
November 14, 2013 Re: Maximum size of an string ? | ||||
---|---|---|---|---|
| ||||
Posted in reply to Jean Christophe | On 11/14/2013 02:10 AM, Jean Christophe wrote: > Has someone tested the maximum size of a D string variable for both 32 > and 64 bits platforms ? Is it different from the maximum size of a char[] ? Both string and char[] are implemented in the same way: a size_t for length and a pointer to data. (D arrays know their sizes.) So, the theoretical limit for both are size_t, which is the equivalent of uint or ulong dependending on 32-bit versus 64-bit. Ali |
November 15, 2013 Re: Maximum size of an string ? | ||||
---|---|---|---|---|
| ||||
Posted in reply to Ali Çehreli |
Than you Ali :0
I assume it is for UTF8 encoding.
That's quite large enough.
JC
On Thursday, 14 November 2013 at 11:50:28 UTC, Ali Çehreli wrote:
> On 11/14/2013 02:10 AM, Jean Christophe wrote:
>
> > Has someone tested the maximum size of a D string variable
> for both 32
> > and 64 bits platforms ? Is it different from the maximum size
> of a char[] ?
>
> Both string and char[] are implemented in the same way: a size_t for length and a pointer to data. (D arrays know their sizes.)
>
> So, the theoretical limit for both are size_t, which is the equivalent of uint or ulong dependending on 32-bit versus 64-bit.
>
> Ali
|
Copyright © 1999-2021 by the D Language Foundation