Re: Memory allocation failed. Why?

2016-11-23 Thread MGW via Digitalmars-d-learn
On Tuesday, 22 November 2016 at 15:53:39 UTC, Steven Schveighoffer wrote: On 11/21/16 11:53 AM, ag0aep6g wrote: Thank you very much for explaining such a difficult and slippery situation.

Re: Memory allocation failed. Why?

2016-11-22 Thread Steven Schveighoffer via Digitalmars-d-learn
On 11/21/16 11:53 AM, ag0aep6g wrote: On Monday, 21 November 2016 at 16:37:32 UTC, Kagamin wrote: Anything in .data and .bss sections and stack. See https://issues.dlang.org/show_bug.cgi?id=15723 Ok, not an actual reference then, but a false pointer. Yes. 100 million bytes is 1/40 of all

Re: Memory allocation failed. Why?

2016-11-21 Thread thedeemon via Digitalmars-d-learn
On Sunday, 20 November 2016 at 17:47:50 UTC, MGW wrote: core.exception.OutOfMemoryError@src\core\exception.d(693): Memory allocation failed Simple program and error. Why? Windows 7 (32) dmd 2.072.0 Making a 100 million bytes array by appending one byte at

Re: Memory allocation failed. Why?

2016-11-21 Thread ag0aep6g via Digitalmars-d-learn
On Monday, 21 November 2016 at 16:37:32 UTC, Kagamin wrote: Anything in .data and .bss sections and stack. See https://issues.dlang.org/show_bug.cgi?id=15723 Ok, not an actual reference then, but a false pointer.

Re: Memory allocation failed. Why?

2016-11-21 Thread Kagamin via Digitalmars-d-learn
On Monday, 21 November 2016 at 11:22:40 UTC, ag0aep6g wrote: Who could "someone" be? It's a self-contained example, and buf doesn't leave the test function. Anything in .data and .bss sections and stack. See https://issues.dlang.org/show_bug.cgi?id=15723 As for GC compaction:

Re: Memory allocation failed. Why?

2016-11-21 Thread ag0aep6g via Digitalmars-d-learn
On 11/21/2016 08:27 AM, Stefan Koch wrote: Someone could still be hanging on to an old Reference of buf. Who could "someone" be? It's a self-contained example, and buf doesn't leave the test function.

Re: Memory allocation failed. Why?

2016-11-20 Thread Stefan Koch via Digitalmars-d-learn
On Monday, 21 November 2016 at 06:45:04 UTC, ag0aep6g wrote: On 11/21/2016 07:36 AM, Stefan Koch wrote: On Monday, 21 November 2016 at 03:58:00 UTC, MGW wrote: On Sunday, 20 November 2016 at 18:58:04 UTC, Basile B. wrote: On Sunday, 20 November 2016 at 17:47:50 UTC, MGW wrote: [...] [...]

Re: Memory allocation failed. Why?

2016-11-20 Thread ag0aep6g via Digitalmars-d-learn
On 11/21/2016 07:36 AM, Stefan Koch wrote: On Monday, 21 November 2016 at 03:58:00 UTC, MGW wrote: On Sunday, 20 November 2016 at 18:58:04 UTC, Basile B. wrote: On Sunday, 20 November 2016 at 17:47:50 UTC, MGW wrote: import core.sys.windows.windows: MessageBoxA; void test() { for(int i;

Re: Memory allocation failed. Why?

2016-11-20 Thread Stefan Koch via Digitalmars-d-learn
On Monday, 21 November 2016 at 03:58:00 UTC, MGW wrote: On Sunday, 20 November 2016 at 18:58:04 UTC, Basile B. wrote: On Sunday, 20 November 2016 at 17:47:50 UTC, MGW wrote: import core.sys.windows.windows: MessageBoxA; void test() { for(int i; i != 10; i++) { ubyte[]

Re: Memory allocation failed. Why?

2016-11-20 Thread MGW via Digitalmars-d-learn
On Sunday, 20 November 2016 at 18:58:04 UTC, Basile B. wrote: On Sunday, 20 November 2016 at 17:47:50 UTC, MGW wrote: import core.sys.windows.windows: MessageBoxA; void test() { for(int i; i != 10; i++) { ubyte[] buf; for(int j; j != 1; j++) buf

Re: Memory allocation failed. Why?

2016-11-20 Thread Nicholas Wilson via Digitalmars-d-learn
On Sunday, 20 November 2016 at 18:58:04 UTC, Basile B. wrote: On Sunday, 20 November 2016 at 17:47:50 UTC, MGW wrote: [...] For me there's no exception. Maybe the GC is poluted. Try to add this after each iteration in the first test loop: import core.memory: GC;

Re: Memory allocation failed. Why?

2016-11-20 Thread Basile B. via Digitalmars-d-learn
On Sunday, 20 November 2016 at 17:47:50 UTC, MGW wrote: import core.sys.windows.windows: MessageBoxA; void test() { for(int i; i != 10; i++) { ubyte[] buf; for(int j; j != 1; j++) buf ~= 65; MessageBoxA(null, "--on for--".ptr,

Memory allocation failed. Why?

2016-11-20 Thread MGW via Digitalmars-d-learn
import core.sys.windows.windows: MessageBoxA; void test() { for(int i; i != 10; i++) { ubyte[] buf; for(int j; j != 1; j++) buf ~= 65; MessageBoxA(null, "--on for--".ptr, "".ptr, 0); // delete buf; // if ON - then