Re: 16MB static arrays again...

2016-08-25 Thread Tomer Filiba via Digitalmars-d
On Wednesday, 24 August 2016 at 18:16:01 UTC, Walter Bright wrote: On 8/24/2016 3:35 AM, Tomer Filiba wrote: ... Our configuration is a struct of several static hash tables (allocated in-place, not via GC). So the entire configuration is contiguous in memory ... If I understand you correctly,

Re: 16MB static arrays again...

2016-08-24 Thread NX via Digitalmars-d
Maybe you can merge this: https://github.com/dlang/dmd/pull/6081

Re: 16MB static arrays again...

2016-08-24 Thread Walter Bright via Digitalmars-d
On 8/24/2016 3:35 AM, Tomer Filiba wrote: On Wednesday, 24 August 2016 at 09:38:43 UTC, Walter Bright wrote: 2) Many times I need memory-contiguity, e.g., several big arrays inside a struct, which is dumped to disk/sent over network. I can't use pointers there. I don't know why pointers cannot

Re: 16MB static arrays again...

2016-08-24 Thread Walter Bright via Digitalmars-d
On 8/24/2016 3:55 AM, Tomer Filiba wrote: On Wednesday, 24 August 2016 at 09:38:43 UTC, Walter Bright wrote: 1) Why? I know everything in compile-time, why force me to (A) allocate it separately in `shared static this()` I'm not sure how that hurts anything. It's just a call to malloc(). Sta

Re: 16MB static arrays again...

2016-08-24 Thread Walter Bright via Digitalmars-d
On 8/24/2016 3:35 AM, Lodovico Giaretta wrote: On Wednesday, 24 August 2016 at 09:38:43 UTC, Walter Bright wrote: I don't know why pointers cannot be used. In my code I have a line like this: static immutable MyStruct[] data = [ MyTemplate!MyArgs ]; This would not work if `MyStruct.sizeof *

Re: 16MB static arrays again...

2016-08-24 Thread Yuxuan Shui via Digitalmars-d
100% agree this limit should be removed. We do have a workaround with dynamic arrays, but that doesn't justify not fixing the problem.

Re: 16MB static arrays again...

2016-08-24 Thread Tomer Filiba via Digitalmars-d
On Wednesday, 24 August 2016 at 09:38:43 UTC, Walter Bright wrote: 1) Why? I know everything in compile-time, why force me to (A) allocate it separately in `shared static this()` I'm not sure how that hurts anything. It's just a call to malloc(). Static this()es require a topological order

Re: 16MB static arrays again...

2016-08-24 Thread Tomer Filiba via Digitalmars-d
On Wednesday, 24 August 2016 at 09:38:43 UTC, Walter Bright wrote: 2) Many times I need memory-contiguity, e.g., several big arrays inside a struct, which is dumped to disk/sent over network. I can't use pointers there. I don't know why pointers cannot be used. Can you show the struct definit

Re: 16MB static arrays again...

2016-08-24 Thread Lodovico Giaretta via Digitalmars-d
On Wednesday, 24 August 2016 at 09:38:43 UTC, Walter Bright wrote: I don't know why pointers cannot be used. In my code I have a line like this: static immutable MyStruct[] data = [ MyTemplate!MyArgs ]; This would not work if `MyStruct.sizeof * MyTemplate!MyArgs.length` is bigger than 16MB,

Re: 16MB static arrays again...

2016-08-24 Thread Tomer Filiba via Digitalmars-d
On Wednesday, 24 August 2016 at 09:24:57 UTC, Shachar Shemesh wrote: I think change that to: @property ref T[N] slice() { That would obviously not work, since the *type* T[N] cannot exist

Re: 16MB static arrays again...

2016-08-24 Thread Ivan Kazmenko via Digitalmars-d
On Wednesday, 24 August 2016 at 07:50:25 UTC, Tomer Filiba wrote: #WEKA #INDUSTRY I found this post from 2007 http://forum.dlang.org/post/fdspch$d3v$1...@digitalmars.com that refers to this post from 2006 http://www.digitalmars.com/d/archives/digitalmars/D/37038.html#N37071 -- and I still don

Re: 16MB static arrays again...

2016-08-24 Thread Walter Bright via Digitalmars-d
On 8/24/2016 12:50 AM, Tomer Filiba wrote: As for the "use dynamic arrays instead", this poses two problems: 1) Why? I know everything in compile-time, why force me to (A) allocate it separately in `shared static this()` I'm not sure how that hurts anything. It's just a call to malloc(). and

Re: 16MB static arrays again...

2016-08-24 Thread Shachar Shemesh via Digitalmars-d
On 24/08/16 12:08, Tomer Filiba wrote: @property T[] slice() { I think change that to: @property ref T[N] slice() { Shachar

Re: 16MB static arrays again...

2016-08-24 Thread Tomer Filiba via Digitalmars-d
On Wednesday, 24 August 2016 at 08:34:24 UTC, rikki cattermole wrote: You're welcome to fix optlink https://github.com/DigitalMars/optlink Or write a whole new linker. Of course there is no reason to not change this for -m32mscoff and -m64 on Windows at least that I am aware of. I'm running

Re: 16MB static arrays again...

2016-08-24 Thread rikki cattermole via Digitalmars-d
On 24/08/2016 7:50 PM, Tomer Filiba wrote: #WEKA #INDUSTRY I found this post from 2007 http://forum.dlang.org/post/fdspch$d3v$1...@digitalmars.com that refers to this post from 2006 http://www.digitalmars.com/d/archives/digitalmars/D/37038.html#N37071 -- and I still don't realize, why do static

Re: 16MB static arrays again...

2016-08-24 Thread Patrick Schluter via Digitalmars-d
On Wednesday, 24 August 2016 at 07:50:25 UTC, Tomer Filiba wrote: #WEKA #INDUSTRY I found this post from 2007 http://forum.dlang.org/post/fdspch$d3v$1...@digitalmars.com that refers to this post from 2006 http://www.digitalmars.com/d/archives/digitalmars/D/37038.html#N37071 -- and I still don

16MB static arrays again...

2016-08-24 Thread Tomer Filiba via Digitalmars-d
#WEKA #INDUSTRY I found this post from 2007 http://forum.dlang.org/post/fdspch$d3v$1...@digitalmars.com that refers to this post from 2006 http://www.digitalmars.com/d/archives/digitalmars/D/37038.html#N37071 -- and I still don't realize, why do static arrays have this size limit on them? An