is it a bug or what?

2015-01-22 Thread collerblade via Digitalmars-d
Dear D user, i have this code: import core.sys.windows.windows; real[] a; while(1) { a.length=4096*4096; a=null; Sleep(2000); } It allocates memory, but its never gets freed, just keep going up, and after 10 secs, memoryexception is thrown. I checked the pointer it is

Re: is it a bug or what?

2015-01-22 Thread collerblade via Digitalmars-d
Also forget to mention, that im using DMD 2.066.1. If i alloc memory with GC.malloc(..), it is handled correcty (and freed). Why GC doesn't frees dynamic arrays?

Re: is it a bug or what?

2015-01-22 Thread Steven Schveighoffer via Digitalmars-d
On 1/22/15 8:44 AM, collerblade wrote: Dear D user, i have this code: import core.sys.windows.windows; real[] a; while(1) { a.length=4096*4096; a=null; Sleep(2000); } It allocates memory, but its never gets freed, just keep going up, and after 10 secs, memoryexception is thrown. I

Re: is it a bug or what?

2015-01-22 Thread collerblade via Digitalmars-d
i tested malloc, and it also run out of mem, except when i manually free the pointer. There is no GC im DMD?

Re: is it a bug or what?

2015-01-22 Thread collerblade via Digitalmars-d
Thank all of u, im going to use malloc.

Re: is it a bug or what?

2015-01-22 Thread collerblade via Digitalmars-d
On Thursday, 22 January 2015 at 14:19:10 UTC, Steven Schveighoffer wrote: On 1/22/15 8:44 AM, collerblade wrote: Dear D user, i have this code: import core.sys.windows.windows; real[] a; while(1) { a.length=4096*4096; a=null; Sleep(2000); } It allocates memory, but its never gets

Re: is it a bug or what?

2015-01-22 Thread bearophile via Digitalmars-d
Steven Schveighoffer: scoped int[] a=new int[whatever_big_size]; ... I would not use this, I think it's scheduled for deprecation, or at least the meaning is scheduled to change. As D introduces some limited static management of memory ownership, the semantics of scoped arrays could be

Re: is it a bug or what?

2015-01-22 Thread Steven Schveighoffer via Digitalmars-d
On 1/22/15 9:40 AM, collerblade wrote: On Thursday, 22 January 2015 at 14:19:10 UTC, Steven Schveighoffer wrote: On 1/22/15 8:44 AM, collerblade wrote: Dear D user, i have this code: import core.sys.windows.windows; real[] a; while(1) { a.length=4096*4096; a=null; Sleep(2000); } It

Bug or what?

2014-08-27 Thread Phil Lavoie via Digitalmars-d
Ok so me and one of my colleagues have been working on some code at a distance. We both use dmd as the compiler. I am under Windows, she OSX. It is not uncommon that she experiences more strictness in the type system than I do. For example, something like this does compile for me, but not

Re: Bug or what?

2014-08-27 Thread Brian Schott via Digitalmars-d
On Wednesday, 27 August 2014 at 19:51:48 UTC, Phil Lavoie wrote: Ok so me and one of my colleagues have been working on some code at a distance. We both use dmd as the compiler. I am under Windows, she OSX. It is not uncommon that she experiences more strictness in the type system than I do.

Re: Bug or what?

2014-08-27 Thread Phil Lavoie via Digitalmars-d
On Wednesday, 27 August 2014 at 19:56:29 UTC, Brian Schott wrote: On Wednesday, 27 August 2014 at 19:51:48 UTC, Phil Lavoie wrote: Ok so me and one of my colleagues have been working on some code at a distance. We both use dmd as the compiler. I am under Windows, she OSX. It is not uncommon

Re: Bug or what?

2014-08-27 Thread MacAsm via Digitalmars-d
On Wednesday, 27 August 2014 at 19:51:48 UTC, Phil Lavoie wrote: Ok so me and one of my colleagues have been working on some code at a distance. We both use dmd as the compiler. I am under Windows, she OSX. It is not uncommon that she experiences more strictness in the type system than I do.

Re: Bug or what?

2014-08-27 Thread Phil Lavoie via Digitalmars-d
On Wednesday, 27 August 2014 at 20:05:27 UTC, MacAsm wrote: On Wednesday, 27 August 2014 at 19:51:48 UTC, Phil Lavoie wrote: Ok so me and one of my colleagues have been working on some code at a distance. We both use dmd as the compiler. I am under Windows, she OSX. It is not uncommon that

Re: Bug or what?

2014-08-27 Thread Phil Lavoie via Digitalmars-d
On Wednesday, 27 August 2014 at 20:28:11 UTC, Phil Lavoie wrote: On Wednesday, 27 August 2014 at 20:05:27 UTC, MacAsm wrote: On Wednesday, 27 August 2014 at 19:51:48 UTC, Phil Lavoie wrote: Ok so me and one of my colleagues have been working on some code at a distance. We both use dmd as the

Re: Bug or what?

2014-08-27 Thread Marco Leise via Digitalmars-d
Am Wed, 27 Aug 2014 20:30:08 + schrieb Phil Lavoie maidenp...@hotmail.com: On Wednesday, 27 August 2014 at 20:28:11 UTC, Phil Lavoie wrote: On Wednesday, 27 August 2014 at 20:05:27 UTC, MacAsm wrote: On Wednesday, 27 August 2014 at 19:51:48 UTC, Phil Lavoie wrote: Ok so me and one