Re: Print RAM used by arrays

2018-12-14 Thread Giovanni Di Maria via Digitalmars-d-learn
Thank you very much for your precious informations. Now i will try. Thank you!!! Giovanni

Re: Anonymous mapped regions increases unlimitely on spawn

2018-12-14 Thread unDEFER via Digitalmars-d-learn
So in digging by this problem, I have made simple patch to druntime. I have added in druntime/src/core/thread.d to final Thread start() nothrow of class Thread import core.stdc.stdio; printf("start Thread\n"); And to ~this() nothrow @nogc import core.stdc.stdio;

Re: Anonymous mapped regions increases unlimitely on spawn

2018-12-14 Thread Boris-Barboris via Digitalmars-d-learn
On Friday, 14 December 2018 at 21:22:05 UTC, unDEFER wrote: So it looks like a bug, and I have reported about it: https://issues.dlang.org/show_bug.cgi?id=19487 Not an expert, but you may wish to try GC.minimize() (https://dlang.org/phobos/core_memory.html#.GC.minimize).

Re: How to initialize a globle variable nicely and properly?

2018-12-14 Thread Rubn via Digitalmars-d-learn
On Saturday, 15 December 2018 at 02:54:55 UTC, Heromyth wrote: We have a module including many globle variables which are needed to be initialized firstly in "shared static this() {}", see here https://github.com/huntlabs/hunt/blob/master/source/hunt/time/Init.d. The problem is that these

Re: How to initialize a globle variable nicely and properly?

2018-12-14 Thread Neia Neutuladh via Digitalmars-d-learn
On Sat, 15 Dec 2018 02:54:55 +, Heromyth wrote: > shared static this() { > writeln("running A in shared static this(), > sharedField=", sharedField); > > Thread th = new Thread(() { }); > th.start(); When you start a D thread, thread-local static constructors

Re: Anonymous mapped regions increases unlimitely on spawn

2018-12-14 Thread unDEFER via Digitalmars-d-learn
So more digging.. dtor of Thread calls in GC.collect() if thread is finished. But it's do nothing because bool not_registered = !next && !prev && (sm_tbeg !is this); is always true... So how to register the thread?

Re: Indentation in emacs d-mode

2018-12-14 Thread Ali Çehreli via Digitalmars-d-learn
On 12/14/2018 05:37 AM, J-S wrote: I'm sorry for asking such a stupid question, but can anybody point me to a precooked consistent set of customizations? Good question. My Emacs D editing is suboptimal as well. Ali

Re: 2D-all?

2018-12-14 Thread Nicholas Wilson via Digitalmars-d-learn
On Friday, 14 December 2018 at 12:43:40 UTC, berni wrote: I've got a lot of code with two-dimensional arrays, where I use stuff like: assert(matrix.all!(a=>a.all!(b=>b>=0))); Does anyone know if there is a 2D-version of all so I can write something like: assert(matrix.all2D!(a=>a>=0));

Indentation in emacs d-mode

2018-12-14 Thread J-S via Digitalmars-d-learn
I've tried (and failed) to get my emacs (26.1) to properly handle indentation (as per the "D style") in d-mode (2.0.9). Things that don't work: - aligning braces below keywords like "foreach", "while", "in" etc: when I put the braces on the following line, I get a 4-space indent (while the

2D-all?

2018-12-14 Thread berni via Digitalmars-d-learn
I've got a lot of code with two-dimensional arrays, where I use stuff like: assert(matrix.all!(a=>a.all!(b=>b>=0))); Does anyone know if there is a 2D-version of all so I can write something like: assert(matrix.all2D!(a=>a>=0));

Re: Map of functions

2018-12-14 Thread Francesco Mecca via Digitalmars-d-learn
On Friday, 14 December 2018 at 17:45:26 UTC, rjframe wrote: On Fri, 14 Dec 2018 16:33:44 +, Giovanni Di Maria wrote: I need the flow of calls. Thank you Giovanni gprof will do this on Linux/BSD if gdc supports the -pg flag (I don't know whether it would, but assume so) and your

How to initialize a globle variable nicely and properly?

2018-12-14 Thread Heromyth via Digitalmars-d-learn
We have a module including many globle variables which are needed to be initialized firstly in "shared static this() {}", see here https://github.com/huntlabs/hunt/blob/master/source/hunt/time/Init.d. The problem is that these variables are not always initialized firstly when are referenced

Re: Map of functions

2018-12-14 Thread Giovanni Di Maria via Digitalmars-d-learn
Do you really have a nested function print() inside a nested function calculate() inside main()? That is, Hi this is only an example of names of funcions but the structure is this: void main() { // maybe some calls to calculate() } void calculate() { // maybe some calls to

Re: Map of functions

2018-12-14 Thread Ivan Kazmenko via Digitalmars-d-learn
On Friday, 14 December 2018 at 15:38:49 UTC, Giovanni Di Maria wrote: Hi Is there an utility to print the functions in a source file, for example: - main() --- calculate() - print() --- simulate() - print() . Thank you very much Giovanni Di Maria Do you really have a nested

Anonymous mapped regions increases unlimitely on spawn

2018-12-14 Thread unDEFER via Digitalmars-d-learn
Hello! I have the program which uses BDB and while testing often makes spawn. And after 12 hours of testing bdb said: mmap: Cannot allocate memory But the problem that I've found that it is not BDB created too many maps. Watching for /proc/[PID]/maps shows that number of anonymous mapped

Map of functions

2018-12-14 Thread Giovanni Di Maria via Digitalmars-d-learn
Hi Is there an utility to print the functions in a source file, for example: - main() --- calculate() - print() --- simulate() - print() . Thank you very much Giovanni Di Maria

Re: Anonymous mapped regions increases unlimitely on spawn

2018-12-14 Thread unDEFER via Digitalmars-d-learn
So it looks like a bug, and I have reported about it: https://issues.dlang.org/show_bug.cgi?id=19487

Re: Map of functions

2018-12-14 Thread Giovanni Di Maria via Digitalmars-d-learn
Thank you very much, Fantastic!!! Giovanni

Re: Map of functions

2018-12-14 Thread rjframe via Digitalmars-d-learn
On Fri, 14 Dec 2018 16:33:44 +, Giovanni Di Maria wrote: > > I need the flow of calls. > Thank you Giovanni gprof will do this on Linux/BSD if gdc supports the -pg flag (I don't know whether it would, but assume so) and your application is working. >From code, you'd need to call a trace