Re: Garbage collector collects live objects

2014-12-12 Thread Ruslan Mullakhmetov via Digitalmars-d-learn
On Thursday, 11 December 2014 at 18:36:59 UTC, Steven Schveighoffer wrote: My analysis so far: 2. In the array append code, the block attributes are obtained via GC.query, which has this code for getting the attributes:

Re: Garbage collector collects live objects

2014-12-12 Thread Ruslan Mullakhmetov via Digitalmars-d-learn
On Friday, 12 December 2014 at 12:53:00 UTC, Ruslan Mullakhmetov wrote: On Thursday, 11 December 2014 at 18:36:59 UTC, Steven Schveighoffer wrote: My analysis so far: 4. If your code is multi-threaded, but using __gshared, it can make the cache incorrect. Are you doing this? the app is

std.bitmanip - bitshift?

2014-12-12 Thread Trollgeir via Digitalmars-d-learn
http://dlang.org/phobos/std_bitmanip.html Does anyone know how to bit-shift a BitArray? I'm trying to make spikes in a neural network travel along the bits as they have various lengths.

Re: Global array

2014-12-12 Thread Paul via Digitalmars-d-learn
On Thursday, 11 December 2014 at 21:35:43 UTC, H. S. Teoh via Digitalmars-d-learn wrote: On Thu, Dec 11, 2014 at 08:56:00PM +, Paul via Digitalmars-d-learn wrote: Is there any merit (or folly!) in storing a large array, that frequently needs to be accessed globally, within a class like so:

Re: Global array

2014-12-12 Thread H. S. Teoh via Digitalmars-d-learn
On Fri, Dec 12, 2014 at 03:04:21PM +, Paul via Digitalmars-d-learn wrote: On Thursday, 11 December 2014 at 21:35:43 UTC, H. S. Teoh via Digitalmars-d-learn wrote: On Thu, Dec 11, 2014 at 08:56:00PM +, Paul via Digitalmars-d-learn wrote: Is there any merit (or folly!) in storing a

Re: Garbage collector collects live objects

2014-12-12 Thread Steven Schveighoffer via Digitalmars-d-learn
On 12/12/14 7:52 AM, Ruslan Mullakhmetov wrote: On Thursday, 11 December 2014 at 18:36:59 UTC, Steven Schveighoffer wrote: My analysis so far: 2. In the array append code, the block attributes are obtained via GC.query, which has this code for getting the attributes:

Re: std.bitmanip - bitshift?

2014-12-12 Thread Steven Schveighoffer via Digitalmars-d-learn
On 12/12/14 8:39 AM, Trollgeir wrote: http://dlang.org/phobos/std_bitmanip.html Does anyone know how to bit-shift a BitArray? I'm trying to make spikes in a neural network travel along the bits as they have various lengths. That is a surprising omission from a bit-oriented type... You also

Re: Allocating aligned memory blocks?

2014-12-12 Thread Steven Schveighoffer via Digitalmars-d-learn
On 12/12/14 2:02 AM, safety0ff wrote: On Friday, 12 December 2014 at 06:17:56 UTC, H. S. Teoh via Digitalmars-d-learn wrote: Is there a way to allocate GC memory blocks in D that are guaranteed to fall on OS page boundaries? I don't know about guarantees, I think that in practice, if your OS

Re: Garbage collector collects live objects

2014-12-12 Thread Ruslan Mullakhmetov via Digitalmars-d-learn
On Friday, 12 December 2014 at 15:50:26 UTC, Steven Schveighoffer wrote: Can I email you at this address? If not, email me at the address from my post to let me know your contact, no reason to work through building issues on the public forum :) -Steve reach me at theambient [] me__com

Re: std.bitmanip - bitshift?

2014-12-12 Thread H. S. Teoh via Digitalmars-d-learn
On Fri, Dec 12, 2014 at 11:13:38AM -0500, Steven Schveighoffer via Digitalmars-d-learn wrote: On 12/12/14 8:39 AM, Trollgeir wrote: http://dlang.org/phobos/std_bitmanip.html Does anyone know how to bit-shift a BitArray? I'm trying to make spikes in a neural network travel along the bits

Re: std.bitmanip - bitshift?

2014-12-12 Thread Steven Schveighoffer via Digitalmars-d-learn
On 12/12/14 2:17 PM, H. S. Teoh via Digitalmars-d-learn wrote: On Fri, Dec 12, 2014 at 11:13:38AM -0500, Steven Schveighoffer via Digitalmars-d-learn wrote: On 12/12/14 8:39 AM, Trollgeir wrote: http://dlang.org/phobos/std_bitmanip.html Does anyone know how to bit-shift a BitArray? I'm

Re: std.bitmanip - bitshift?

2014-12-12 Thread H. S. Teoh via Digitalmars-d-learn
Here's my implementation of = and = for BitArray: https://github.com/D-Programming-Language/phobos/pull/2797 While working with the code, I found that there are a lot of areas that need improvement. If I have some time I'll file separate PR's for them. T -- VI = Visual Irritation

The package feature is ignored when the file name is package.di

2014-12-12 Thread Jeremy DeHaan via Digitalmars-d-learn
Is this on purpose? Granted, I almost never use interface files, but I had a whim to use them for what I was working on today. Everything worked fine when I renamed the file to package.d, but apparently package.di is not acceptible.

std.array oddness

2014-12-12 Thread earthfront via Digitalmars-d-learn
Hello! I was attempting project euler problem 22 and seeing something weird going on with the array function in std.array. I made the following code to demonstrate. Given names.txt: -- MARY,PATRICIA,LINDA,BARBARA,ELIZABETH -- and code: -- import

Re: std.array oddness

2014-12-12 Thread ketmar via Digitalmars-d-learn
On Sat, 13 Dec 2014 05:15:08 + earthfront via Digitalmars-d-learn digitalmars-d-learn@puremagic.com wrote: Am I using array incorrectly? no, you are using `.byLine` incorrectly. ;-) `.byLine` reuses it's internal buffer for each line, so you have to copy that buffer. like this: import

Are there any methods like isDestroyed or isDisposed to detect whether some object is destroyed or not?

2014-12-12 Thread Andrey Derzhavin via Digitalmars-d-learn
Hello! We have object, for example, objA. ObjectAType objA = new ObjectAType(...); // we have a many references to objA void someFunction1(...) { // destroying the objA destroy(one_of_the_refToObjA); // } void someFunction2() { // segmentation fault if the objA is

Re: Are there any methods like isDestroyed or isDisposed to detect whether some object is destroyed or not?

2014-12-12 Thread ketmar via Digitalmars-d-learn
On Sat, 13 Dec 2014 07:03:22 + Andrey Derzhavin via Digitalmars-d-learn digitalmars-d-learn@puremagic.com wrote: Hello! We have object, for example, objA. ObjectAType objA = new ObjectAType(...); // we have a many references to objA void someFunction1(...) { // destroying

Re: Are there any methods like isDestroyed or isDisposed to detect whether some object is destroyed or not?

2014-12-12 Thread ketmar via Digitalmars-d-learn
On Sat, 13 Dec 2014 07:03:22 + Andrey Derzhavin via Digitalmars-d-learn digitalmars-d-learn@puremagic.com wrote: p.s. you can emulate weak links if this is what you want to have. i.e. references to object that will not stop GC to collect that object and which will be auto-nullified if the

Re: Are there any methods like isDestroyed or isDisposed to detect whether some object is destroyed or not?

2014-12-12 Thread ketmar via Digitalmars-d-learn
On Sat, 13 Dec 2014 07:03:22 + Andrey Derzhavin via Digitalmars-d-learn digitalmars-d-learn@puremagic.com wrote: p.p.s. please-please-please don't invent other hacks with `rt_attachDisposeEvent()`! such hackery will not do you good in the long term. signature.asc Description: PGP signature