Re: GC deadlocks on linux

2015-02-27 Thread ketmar via Digitalmars-d-learn
On Sat, 28 Feb 2015 06:09:16 +0100, Martin Nowak wrote: Meanwhile the author of daemonized came up with another idea, using exec instead of fork. https://github.com/NCrashed/daemonize/issues/2 ahem. http://forum.dlang.org/post/mc35ap$2dvo$5...@digitalmars.com signature.asc Description: PGP

Re: GC deadlocks on linux

2015-02-27 Thread Martin Nowak via Digitalmars-d-learn
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 02/18/2015 09:27 PM, Byron Heads wrote: I have a medium size daemon application that uses several threads, libasync, and daemonize. On windows it runs correctly with GC enabled, but on linux the GC causes a deadlock while allocating memory.

Re: Does static ctor/dtor of struct behave differently in 2.067-b2?

2015-02-27 Thread ketmar via Digitalmars-d-learn
On Fri, 27 Feb 2015 23:58:16 +, amber wrote: On Friday, 27 February 2015 at 23:50:51 UTC, amber wrote: Hi All, [snip] Thanks, amber [edited subject] Sorry I should add that I'm talking about static ctor/dtor of struct. The bug I see with 2.067-b2 is this: 1. static this() {}

DMD Zip for Mac OS X

2015-02-27 Thread Mike Parker via Digitalmars-d-learn
I'm not a Mac user and I'm fairly clueless about it. The DMD zip for OS X contains one executable. I assume it's a 64-bit binary. Is that true?

Re: @trusted and return ref

2015-02-27 Thread Steven Schveighoffer via Digitalmars-d-learn
On 2/27/15 3:29 AM, Kagamin wrote: On Thursday, 26 February 2015 at 16:25:59 UTC, Steven Schveighoffer wrote: However, we have an issue here. At any point inside the code, you could do: oldcount = count; And now, there is still potentially a dangling pointer somewhere. This means every place

Re: @trusted and return ref

2015-02-27 Thread via Digitalmars-d-learn
On Friday, 27 February 2015 at 10:49:25 UTC, Ola Fosheim Grøstad wrote: 2. You construct a transform T(x) that can transform language D into x. = D is proven safe. Eh: 2. You construct a transform T(x) that can transform programs in language D into P...

Re: 3 dimension arrays

2015-02-27 Thread Andrey via Digitalmars-d-learn
On Thursday, 26 February 2015 at 23:25:22 UTC, Ali Çehreli wrote: On 02/26/2015 12:01 PM, Andrey wrote: HI guys!!! Have a problem with 3d array memory allocation in next code: // class NeuronNet(T, const uint layersNum) { T[]

Re: On opCmp

2015-02-27 Thread anonymous via Digitalmars-d-learn
On Friday, 27 February 2015 at 11:04:51 UTC, Nordlöw wrote: Is there a more compact way to describe the opCmp function in the following struct struct Hit { size_t count; // number of walkers that found this node NWeight rank; // rank (either minimum distance or maximum strength)

Re: Will D have a serious dedicated well supported IDE like Visual Studio or Eclipse?

2015-02-27 Thread Russel Winder via Digitalmars-d-learn
On Fri, 2015-02-27 at 04:12 +, AJ via Digitalmars-d-learn wrote: […] I am in the same boat and totally agree. It's tough going from the user-experience of IntelliJ IDEA or Visual Studio back to vi on OS X with D. There seems to be a large hole in support for D debugging outside of

Re: Will D have a serious dedicated well supported IDE like Visual Studio or Eclipse?

2015-02-27 Thread Martin Krejcirik via Digitalmars-d-learn
On Friday, 27 February 2015 at 07:08:26 UTC, Ali Çehreli wrote: What version of gdb is needed and is that version easy to install? Something from late 2014 or newer is the best (7.8.50-cvs or 7.9.50-cvs) as it has got Ian's patches merged, but even an old stock Debian gdb (7.4.1) works

Re: On opCmp

2015-02-27 Thread Steven Schveighoffer via Digitalmars-d-learn
On 2/27/15 6:04 AM, Nordlöw wrote: Is there a more compact way to describe the opCmp function in the following struct struct Hit { size_t count; // number of walkers that found this node NWeight rank; // rank (either minimum distance or maximum strength) auto opCmp(const Hit

Re: On opCmp

2015-02-27 Thread Ali Çehreli via Digitalmars-d-learn
On 02/27/2015 03:04 AM, Nordlöw wrote: Is there a more compact way to describe the opCmp function in the following struct Please see: http://forum.dlang.org/thread/lnr99a$vvd$1...@digitalmars.com#post-lnr99a:24vvd:241:40digitalmars.com Ali

Re: @trusted and return ref

2015-02-27 Thread via Digitalmars-d-learn
On Friday, 27 February 2015 at 08:34:24 UTC, Kagamin wrote: @safe is supposed to provide safety, if you can give an example when it doesn't, you can report a bug. There are indeed bugs in implementation of safety, like escaping of local variables, but they are supposed to be fixed eventually.

Re: @trusted and return ref

2015-02-27 Thread Kagamin via Digitalmars-d-learn
If you can't give an example of unsafety easily, that's already quite important. Compare to C, where one can provide such an example easily. If you want to write a mathematical prover, that won't hurt, though such tools don't need language support, lints and provers were written even for C.

Re: @trusted and return ref

2015-02-27 Thread Kagamin via Digitalmars-d-learn
On Thursday, 26 February 2015 at 16:25:59 UTC, Steven Schveighoffer wrote: However, we have an issue here. At any point inside the code, you could do: oldcount = count; And now, there is still potentially a dangling pointer somewhere. This means every place count is used must be checked. In

Re: @trusted and return ref

2015-02-27 Thread Kagamin via Digitalmars-d-learn
On Thursday, 26 February 2015 at 20:56:52 UTC, Ola Fosheim Grøstad wrote: Well, but @safe code is not verified either... It is inferred @safe based on a fixed set of criterions, but not verified. To verify you need more, and you have to start with strong typing. @safe is supposed to provide

Re: @trusted and return ref

2015-02-27 Thread via Digitalmars-d-learn
On Friday, 27 February 2015 at 09:33:43 UTC, Kagamin wrote: If you can't give an example of unsafety easily, that's already quite important. Compare to C, where one can provide such an example easily. Yes, that is true. Also, if you are conservative in C++ you also get pretty good safety

On opCmp

2015-02-27 Thread Nordlöw
Is there a more compact way to describe the opCmp function in the following struct struct Hit { size_t count; // number of walkers that found this node NWeight rank; // rank (either minimum distance or maximum strength) auto opCmp(const Hit rhs) const { if

Does static ctor/dtor behave differently in 2.067-b2?

2015-02-27 Thread amber via Digitalmars-d-learn
Hi All, I am just wondering if dmd 2067-b2 invokes static this() and static ~this() differently to 2066.1 I have a strange bug when I use DMD2.067-b2 and it looks a lot like the static ctor/dtor are run from a separate thread to main() and unittest{} blocks. When I run under 2066.1 the code

Re: Does static ctor/dtor of struct behave differently in 2.067-b2?

2015-02-27 Thread amber via Digitalmars-d-learn
On Friday, 27 February 2015 at 23:50:51 UTC, amber wrote: Hi All, [snip] Thanks, amber [edited subject] Sorry I should add that I'm talking about static ctor/dtor of struct. The bug I see with 2.067-b2 is this: 1. static this() {} called and static fields of struct are initialised 2.

Re: Getting what came *before* the results of a find call

2015-02-27 Thread Mark Isaacson via Digitalmars-d-learn
Not that it's super important, but the link didn't copy well, so here's that: http://www.informit.com/articles/article.aspx?p=1407357seqNum=12

Re: Getting what came *before* the results of a find call

2015-02-27 Thread Jonathan M Davis via Digitalmars-d-learn
On Friday, February 27, 2015 14:42:17 Ali Çehreli via Digitalmars-d-learn wrote: On 02/27/2015 02:29 PM, Mark Isaacson wrote: What's the idiomatic way of getting everything *before* the results of a call to find? assert(hello world.find( world).what_goes_here??? == hello); In an

Getting what came *before* the results of a find call

2015-02-27 Thread Mark Isaacson via Digitalmars-d-learn
What's the idiomatic way of getting everything *before* the results of a call to find? assert(hello world.find( world).what_goes_here??? == hello); In an article Andrei wrote a few years ago (http://www.informit.com/articles/article.aspx…) he mentioned a function like this with the name

Re: Getting what came *before* the results of a find call

2015-02-27 Thread Mark Isaacson via Digitalmars-d-learn
Ahhh right - forgot about that. Thanks!

Re: Getting what came *before* the results of a find call

2015-02-27 Thread Ali Çehreli via Digitalmars-d-learn
On 02/27/2015 02:29 PM, Mark Isaacson wrote: What's the idiomatic way of getting everything *before* the results of a call to find? assert(hello world.find( world).what_goes_here??? == hello); In an article Andrei wrote a few years ago (http://www.informit.com/articles/article.aspx…) he