www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.learn - Current size of GC memory

reply "Namespace" <rswhite4 googlemail.com> writes:
Is there a way to find out how much memory the GC used currently?
Nov 03 2013
parent reply "Namespace" <rswhite4 googlemail.com> writes:
On Sunday, 3 November 2013 at 13:05:08 UTC, Namespace wrote:
 Is there a way to find out how much memory the GC used 
 currently?
Does not seem to be possible. Would have been nice.
Nov 03 2013
parent reply Rainer Schuetze <r.sagitario gmx.de> writes:
On 03.11.2013 19:53, Namespace wrote:
 On Sunday, 3 November 2013 at 13:05:08 UTC, Namespace wrote:
 Is there a way to find out how much memory the GC used currently?
Does not seem to be possible. Would have been nice.
There is an "unofficial" function gc_stats here: https://github.com/D-Programming-Language/druntime/blob/master/src/gc/proxy.d#L276
Nov 03 2013
parent reply "Namespace" <rswhite4 googlemail.com> writes:
On Monday, 4 November 2013 at 06:38:41 UTC, Rainer Schuetze wrote:
 On 03.11.2013 19:53, Namespace wrote:
 On Sunday, 3 November 2013 at 13:05:08 UTC, Namespace wrote:
 Is there a way to find out how much memory the GC used 
 currently?
Does not seem to be possible. Would have been nice.
There is an "unofficial" function gc_stats here: https://github.com/D-Programming-Language/druntime/blob/master/src/gc/proxy.d#L276
And how can I use it? import gc.proxy; doesn't work.
Nov 04 2013
parent reply Rainer Schuetze <r.sagitario gmx.de> writes:
On 04.11.2013 11:23, Namespace wrote:
 On Monday, 4 November 2013 at 06:38:41 UTC, Rainer Schuetze wrote:
 On 03.11.2013 19:53, Namespace wrote:
 On Sunday, 3 November 2013 at 13:05:08 UTC, Namespace wrote:
 Is there a way to find out how much memory the GC used currently?
Does not seem to be possible. Would have been nice.
There is an "unofficial" function gc_stats here: https://github.com/D-Programming-Language/druntime/blob/master/src/gc/proxy.d#L276
And how can I use it? import gc.proxy; doesn't work.
You need to add <dmd-install-path>/src/druntime/src to the import search paths.
Nov 04 2013
parent reply "Sean Kelly" <sean invisibleduck.org> writes:
On Monday, 4 November 2013 at 22:25:14 UTC, Rainer Schuetze wrote:
 On 04.11.2013 11:23, Namespace wrote:
 And how can I use it? import gc.proxy; doesn't work.
You need to add <dmd-install-path>/src/druntime/src to the import search paths.
Or simply declare the extern (C) function in your code.
Nov 05 2013
parent reply "Namespace" <rswhite4 googlemail.com> writes:
On Tuesday, 5 November 2013 at 19:49:06 UTC, Sean Kelly wrote:
 On Monday, 4 November 2013 at 22:25:14 UTC, Rainer Schuetze 
 wrote:
 On 04.11.2013 11:23, Namespace wrote:
 And how can I use it? import gc.proxy; doesn't work.
You need to add <dmd-install-path>/src/druntime/src to the import search paths.
Or simply declare the extern (C) function in your code.
And what is with the return type? It's a struct. You must import it.
Nov 05 2013
parent "Sean Kelly" <sean invisibleduck.org> writes:
On Tuesday, 5 November 2013 at 20:19:03 UTC, Namespace wrote:
 And what is with the return type? It's a struct. You must 
 import it.
You don't have to import it. The layout of the struct isn't going to change any time soon. Just copy/paste the definition into your code. Or import it if you want. It's just that the original definition of this stuff is in a portion of Druntime that was never intended to be published to a location where the module could be imported by users.
Nov 05 2013