GC and MMM

2015-08-20 Thread Ilya Yaroshenko via Digitalmars-d-learn
Hi All! Does GC scan manually allocated memory? I want to use huge manually allocated hash tables and I don't want to GC scan them because performance reasons. Best regards, Ilya

Re: automatically verifying code samples in phobos docs

2015-08-20 Thread Jacob Carlborg via Digitalmars-d-learn
On 2015-08-20 01:41, Laeeth Isharc wrote: Should this be done? How? Just use a documented unit tests block: /// unittest { // code goes here } It will be run as part of the unit tests and it will be included when generating the documentation. Although I don't have a good solution for

Re: automatically verifying code samples in phobos docs

2015-08-20 Thread wobbles via Digitalmars-d-learn
On Thursday, 20 August 2015 at 06:28:44 UTC, Jacob Carlborg wrote: On 2015-08-20 01:41, Laeeth Isharc wrote: [...] Just use a documented unit tests block: /// unittest { // code goes here } It will be run as part of the unit tests and it will be included when generating the

Re: unusual bare metal target: Amazon Dash

2015-08-20 Thread Mike via Digitalmars-d-learn
On Tuesday, 18 August 2015 at 01:32:13 UTC, Laeeth Isharc wrote: I don't know whether D can run on one, but from a quick look perhaps feasible. Running D on something like this (perhaps it's underpowered, but looked to have similar spec to what people had been doing with related ARM cortex

Re: automatically verifying code samples in phobos docs

2015-08-20 Thread Jacob Carlborg via Digitalmars-d-learn
On 2015-08-20 10:49, wobbles wrote: Will AutoProtocol().idup not make this work? Make an immutable copy of whatever AutoProtocol() returns, which should be then immutable char[] (i.e. string) Yes, that should work. -- /Jacob Carlborg

Re: New to D - playing with Thread and false Sharing

2015-08-20 Thread Rikki Cattermole via Digitalmars-d-learn
On 8/21/2015 3:37 AM, Dejan Lekic wrote: Keep in mind that in D everything is thread-local by default! :) For shared resources use __gshared or shared (although I do not know for sure whether shared works or not). Note: shared is __gshared but with mutex's added.

Re: New to D - playing with Thread and false Sharing

2015-08-20 Thread Nicholas Wilson via Digitalmars-d-learn
On Thursday, 20 August 2015 at 20:01:58 UTC, tony288 wrote: On Thursday, 20 August 2015 at 15:37:35 UTC, Dejan Lekic wrote: [...] Thanks, I changed the code and the previous one was already using shared. import std.stdio; import core.time; import core.thread; [...] Keep in mind java may

Re: GC and MMM

2015-08-20 Thread luminousone via Digitalmars-d-learn
On Thursday, 20 August 2015 at 17:13:33 UTC, Ilya Yaroshenko wrote: Hi All! Does GC scan manually allocated memory? I want to use huge manually allocated hash tables and I don't want to GC scan them because performance reasons. Best regards, Ilya Yes, just don't store any GC managed

Re: GC and MMM

2015-08-20 Thread rsw0x via Digitalmars-d-learn
On Thursday, 20 August 2015 at 17:13:33 UTC, Ilya Yaroshenko wrote: Hi All! Does GC scan manually allocated memory? I want to use huge manually allocated hash tables and I don't want to GC scan them because performance reasons. Best regards, Ilya GC does not scan memory allocated with

Re: unusual bare metal target: Amazon Dash

2015-08-20 Thread Laeeth Isharc via Digitalmars-d-learn
On Thursday, 20 August 2015 at 09:08:02 UTC, Mike wrote: On Tuesday, 18 August 2015 at 01:32:13 UTC, Laeeth Isharc wrote: I don't know whether D can run on one, but from a quick look perhaps feasible. Running D on something like this (perhaps it's underpowered, but looked to have similar spec

Re: Reading dmd's source code

2015-08-20 Thread jmh530 via Digitalmars-d-learn
On Thursday, 20 August 2015 at 04:25:01 UTC, Freddy wrote: dmd's source code is very big, are there tips for reading it(important files)? Might make for a good http://wiki.dlang.org/ page, particularly after the transition to ddmd.

Re: automatically verifying code samples in phobos docs

2015-08-20 Thread jmh530 via Digitalmars-d-learn
On Thursday, 20 August 2015 at 06:28:44 UTC, Jacob Carlborg wrote: On 2015-08-20 01:41, Laeeth Isharc wrote: Should this be done? How? Just use a documented unit tests block: /// unittest { // code goes here } It will be run as part of the unit tests and it will be included when

Re: Why does not my program is not running?

2015-08-20 Thread anonymous via Digitalmars-d-learn
On Thursday 20 August 2015 22:31, Unknow wrote: I'm writed a program for calculating the e number. I can compile the source code but when i try run the program, system gives 'program stopped working' error. Source code; // main.d module main; import std.file; import std.conv;

Re: Why does not my program is not running?

2015-08-20 Thread Steven Schveighoffer via Digitalmars-d-learn
On 8/20/15 4:31 PM, Unknow wrote: module main; import std.file; import std.conv; long factorial(long i){ if (i == 0){ return 1; }else{ return(i * factorial(i-1)); } } Note, this is not going to work. At 21!, long will run out of bits. From

Re: Why does not my program is not running?

2015-08-20 Thread anonymous2 via Digitalmars-d-learn
On Thursday, 20 August 2015 at 21:11:07 UTC, anonymous wrote: I severely limited the range of integer. I don't know off the top of my head how large you can make it without hitting overflow. I removed the file writing, because I'm not sure if you want to write it only when it doesn't exist,

Re: Why does not my program is not running?

2015-08-20 Thread anonymous via Digitalmars-d-learn
On Thursday 20 August 2015 23:11, anonymous wrote: 2) *integer++ doesn't do what you think it does. The increment is done before the dereference. You could fix this, but: I got that one wrong. Steven Schveighoffer has it right. The pointer is incremented after the currently pointed-to value

Re: Why does not my program is not running?

2015-08-20 Thread Unknow via Digitalmars-d-learn
On Thursday, 20 August 2015 at 21:10:27 UTC, Steven Schveighoffer wrote: On 8/20/15 4:31 PM, Unknow wrote: module main; import std.file; import std.conv; long factorial(long i){ if (i == 0){ return 1; }else{ return(i * factorial(i-1)); } } Note, this is not

Why does not my program is not running?

2015-08-20 Thread Unknow via Digitalmars-d-learn
I'm writed a program for calculating the e number. I can compile the source code but when i try run the program, system gives 'program stopped working' error. Source code; // main.d module main; import std.file; import std.conv; long factorial(long i){ if (i == 0){

Re: App Build Error

2015-08-20 Thread Benjamin via Digitalmars-d-learn
On Monday, 17 August 2015 at 01:02:51 UTC, Nicholas Wilson wrote: On Sunday, 16 August 2015 at 17:33:52 UTC, Benjamin wrote: I'm having an issue with building my app - even a simple trivial app (shown below). [...] OS X version? Have you configured your dmd.conf? iirc it requires linker

flush MessageBox

2015-08-20 Thread Chris via Digitalmars-d-learn
Is there a way to flush a thread's message box other than aborting the thread? MailBox is private: https://github.com/D-Programming-Language/phobos/blob/master/std/concurrency.d#L1778

New to D - playing with Thread and false Sharing

2015-08-20 Thread tony288 via Digitalmars-d-learn
Hi, I have been playing for a short time with D. I wanted to play with Thread, which I believe is lower level than concurrency and parallelism library (might be wrong here ?) . I was also learning and reading about false sharing - multiple thread = same cacheline. And I decided to play with

Re: New to D - playing with Thread and false Sharing

2015-08-20 Thread Dejan Lekic via Digitalmars-d-learn
Keep in mind that in D everything is thread-local by default! :) For shared resources use __gshared or shared (although I do not know for sure whether shared works or not).

Re: New to D - playing with Thread and false Sharing

2015-08-20 Thread tony288 via Digitalmars-d-learn
On Thursday, 20 August 2015 at 15:37:35 UTC, Dejan Lekic wrote: Keep in mind that in D everything is thread-local by default! :) For shared resources use __gshared or shared (although I do not know for sure whether shared works or not). Thanks, I changed the code and the previous one was

Re: Why does not my program is not running?

2015-08-20 Thread Steven Schveighoffer via Digitalmars-d-learn
On 8/20/15 5:15 PM, anonymous2 wrote: On Thursday, 20 August 2015 at 21:11:07 UTC, anonymous wrote: I severely limited the range of integer. I don't know off the top of my head how large you can make it without hitting overflow. with integer == 66 the factorial overflows and becomes 0 (on my

Re: flush MessageBox

2015-08-20 Thread John Colvin via Digitalmars-d-learn
On Thursday, 20 August 2015 at 15:25:57 UTC, Chris wrote: Is there a way to flush a thread's message box other than aborting the thread? MailBox is private: https://github.com/D-Programming-Language/phobos/blob/master/std/concurrency.d#L1778 flush from inside the thread? You could call