Re: Disabling GC in D

2016-01-22 Thread Dibyendu Majumdar via Digitalmars-d-learn
On Friday, 22 January 2016 at 05:15:13 UTC, Mike Parker wrote: On Thursday, 21 January 2016 at 23:06:55 UTC, Dibyendu Majumdar wrote: On Thursday, 21 January 2016 at 22:44:14 UTC, H. S. Teoh wrote: Hi - I want to be sure that my code is not allocating memory via the GC allocator; but when shipp

Re: Disabling GC in D

2016-01-21 Thread Mike Parker via Digitalmars-d-learn
On Thursday, 21 January 2016 at 23:06:55 UTC, Dibyendu Majumdar wrote: On Thursday, 21 January 2016 at 22:44:14 UTC, H. S. Teoh wrote: Hi - I want to be sure that my code is not allocating memory via the GC allocator; but when shipping I don't need to disable GC - it is mostly a development che

Re: Disabling GC in D

2016-01-21 Thread Dibyendu Majumdar via Digitalmars-d-learn
On Thursday, 21 January 2016 at 22:44:14 UTC, H. S. Teoh wrote: Hi - I want to be sure that my code is not allocating memory via the GC allocator; but when shipping I don't need to disable GC - it is mostly a development check. I want to manage all memory allocation manually via malloc/free.

Re: Disabling GC in D

2016-01-21 Thread H. S. Teoh via Digitalmars-d-learn
On Thu, Jan 21, 2016 at 10:43:31PM +, Dibyendu Majumdar via Digitalmars-d-learn wrote: > On Thursday, 21 January 2016 at 22:34:43 UTC, cym13 wrote: > >Out of curiosity, why would you force not being able to allocate > >memory? > > Hi - I want to be sure that my code is not allocating memory v

Re: Disabling GC in D

2016-01-21 Thread Dibyendu Majumdar via Digitalmars-d-learn
On Thursday, 21 January 2016 at 22:34:43 UTC, cym13 wrote: Out of curiosity, why would you force not being able to allocate memory? Hi - I want to be sure that my code is not allocating memory via the GC allocator; but when shipping I don't need to disable GC - it is mostly a development chec

Re: Disabling GC in D

2016-01-21 Thread cym13 via Digitalmars-d-learn
On Thursday, 21 January 2016 at 22:20:13 UTC, Dibyendu Majumdar wrote: On Thursday, 21 January 2016 at 22:15:13 UTC, Chris Wright wrote: Finally, you can use gc_setProxy() with a a GC proxy you create. Have it throw an exception instead of allocating. That means you will get crashes instead o

Re: Disabling GC in D

2016-01-21 Thread Dibyendu Majumdar via Digitalmars-d-learn
On Thursday, 21 January 2016 at 22:15:13 UTC, Chris Wright wrote: Finally, you can use gc_setProxy() with a a GC proxy you create. Have it throw an exception instead of allocating. That means you will get crashes instead of memory leaks if something uses the GC when it shouldn't. gc_setProx

Re: Disabling GC in D

2016-01-21 Thread Chris Wright via Digitalmars-d-learn
On Thu, 21 Jan 2016 21:54:36 +, Dibyendu Majumdar wrote: > Is there a way to disable GC in D? > I am aware of the @nogc qualifier but I would like to completely disable > GC for the whole app/library. > > Regards Dibyendu In order to suppress GC collections, you can call core.memory.GC.disab

Re: Disabling GC in D

2016-01-21 Thread cym13 via Digitalmars-d-learn
On Thursday, 21 January 2016 at 21:54:36 UTC, Dibyendu Majumdar wrote: Is there a way to disable GC in D? I am aware of the @nogc qualifier but I would like to completely disable GC for the whole app/library. Regards Dibyendu You should read the core.memory.GC section ( http://dlang.org/pho

Re: Disabling GC in D

2016-01-21 Thread Brad Anderson via Digitalmars-d-learn
On Thursday, 21 January 2016 at 21:54:36 UTC, Dibyendu Majumdar wrote: Is there a way to disable GC in D? I am aware of the @nogc qualifier but I would like to completely disable GC for the whole app/library. Regards Dibyendu GC.disable(); This prevents the garbage collector from running bu

Disabling GC in D

2016-01-21 Thread Dibyendu Majumdar via Digitalmars-d-learn
Is there a way to disable GC in D? I am aware of the @nogc qualifier but I would like to completely disable GC for the whole app/library. Regards Dibyendu