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

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: Garbage collector collects live objects

2014-12-10 Thread Ruslan Mullakhmetov via Digitalmars-d-learn
On Wednesday, 10 December 2014 at 02:43:19 UTC, ketmar via Digitalmars-d-learn wrote: On Tue, 09 Dec 2014 17:18:44 + Ruslan Mullakhmetov via Digitalmars-d-learn digitalmars-d-learn@puremagic.com wrote: but i still have no clue how to overcome GC =( why do you want to fight with GC? most

Re: Garbage collector collects live objects

2014-12-10 Thread Ruslan Mullakhmetov via Digitalmars-d-learn
On Tuesday, 9 December 2014 at 21:38:57 UTC, Steven Schveighoffer wrote: On 12/9/14 2:56 PM, Steven Schveighoffer wrote: On 12/9/14 12:40 PM, Ruslan Mullakhmetov wrote: array holds 11 64bit pointers but it's block size is only 128 bytes 11 * 64 = 704 bytes. what's wrong

Re: Garbage collector collects live objects

2014-12-10 Thread Ruslan Mullakhmetov via Digitalmars-d-learn
On Wednesday, 10 December 2014 at 08:46:12 UTC, Ruslan Mullakhmetov wrote: yes. that was the mistake. also after fixing bug in Blk Attributes printing i got more reasonable attrs for object blk: FINALIZE for array of objects blk: NO_SCAN APPENDABLE this is sound good except for NO_SCAN

Re: Garbage collector collects live objects

2014-12-10 Thread Ruslan Mullakhmetov via Digitalmars-d-learn
On Wednesday, 10 December 2014 at 12:52:24 UTC, Ruslan Mullakhmetov wrote: why and how this happens? can anybody explain it to me? I tried to extract this and saw NO NO_SCAN attrs after moving blk: the following piece of output produced by http://dpaste.dzfl.pl/6f773e17de92 len: 6

Re: Garbage collector collects live objects

2014-12-10 Thread Ruslan Mullakhmetov via Digitalmars-d-learn
On Wednesday, 10 December 2014 at 13:00:45 UTC, ketmar via Digitalmars-d-learn wrote: can you give us a minified code that causes this behavior? see previous post. the problem vanish if i try to extract it.

Garbage collector collects live objects

2014-12-09 Thread Ruslan Mullakhmetov via Digitalmars-d-learn
Hi, I experience very strange problem: GC somehow collects live objects. I found it because i got segfaults. After debugging and tracing i found this is because of accessing not allocated memory. I did the following checks: - added to some class invariant check for access to suspicious

Re: Garbage collector collects live objects

2014-12-09 Thread Ruslan Mullakhmetov via Digitalmars-d-learn
On Tuesday, 9 December 2014 at 14:23:06 UTC, Steven Schveighoffer wrote: On 12/9/14 8:54 AM, Ruslan Mullakhmetov wrote: Hi, I experience very strange problem: GC somehow collects live objects. I found it because i got segfaults. After debugging and tracing i found this is because

Re: Garbage collector collects live objects

2014-12-09 Thread Ruslan Mullakhmetov via Digitalmars-d-learn
On Tuesday, 9 December 2014 at 16:53:02 UTC, Steven Schveighoffer wrote: On 12/9/14 11:17 AM, ketmar via Digitalmars-d-learn wrote: On Tue, 09 Dec 2014 14:52:53 + Ruslan Mullakhmetov via Digitalmars-d-learn digitalmars-d-learn@puremagic.com wrote: On Tuesday, 9 December 2014 at 14:23:06

Re: Garbage collector collects live objects

2014-12-09 Thread Ruslan Mullakhmetov via Digitalmars-d-learn
On Tuesday, 9 December 2014 at 16:13:25 UTC, Dicebot wrote: It may happen if only reference to an object is stored in memory block marked as data-only (using ubyte[] for a buffer is probably most common reason I have encountered) Thanks for interesting hypothesis, but that's not the issue.

Re: Garbage collector collects live objects

2014-12-09 Thread Ruslan Mullakhmetov via Digitalmars-d-learn
On Tuesday, 9 December 2014 at 19:56:30 UTC, Steven Schveighoffer wrote: On 12/9/14 12:40 PM, Ruslan Mullakhmetov wrote: On Tuesday, 9 December 2014 at 16:13:25 UTC, Dicebot wrote: i checked attributes for GC block holding this array: FINALIZE NO_SCAN NO_MOVE APPENDABLE NO_INTERIOR That does

Re: trace GC work

2014-02-19 Thread Ruslan Mullakhmetov
On Tuesday, 18 February 2014 at 22:59:00 UTC, Mike wrote: On Tuesday, 18 February 2014 at 18:10:40 UTC, Ruslan Mullakhmetov wrote: Hi, Is it possible to trace GC allocation calls to determine times of program death and have some stats? So i want the following information: - garbage

trace GC work

2014-02-18 Thread Ruslan Mullakhmetov
Hi, Is it possible to trace GC allocation calls to determine times of program death and have some stats? So i want the following information: - garbage collection starts at {time} - garbage collection stops at {time} - (optionally) gc took {time}, collected {size} bytes thanks.

std.bigint.BigInt and const modifier

2014-02-16 Thread Ruslan Mullakhmetov
BigInt is a struct == ValueType, suppose i can assign const(BigInt) to BigInt const(BigInt)/const(BigInt) do not compile. Is it a bug or design considerations? test.d import std.stdio; import std.bigint; void foo(BigInt b) { std.stdio.writefln(foo(%s), b); } void main() {

Re: std.bigint.BigInt and const modifier

2014-02-16 Thread Ruslan Mullakhmetov
On Sunday, 16 February 2014 at 20:36:32 UTC, bearophile wrote: Ruslan Mullakhmetov: Is it a bug or design considerations? It was a const correctness bug, but it's already fixed in recent D compilers. Bye, bearophile recent D compilers. i use v2.064.2. is it outdated ?

Re: core.sys.posix.unistd link error

2013-09-22 Thread Ruslan Mullakhmetov
Didn't catch. How can I use it at runtime? I can not link to actually C function? On Saturday, 21 September 2013 at 19:40:48 UTC, Jonathan M Davis wrote: On Saturday, September 21, 2013 20:30:00 Ruslan Mullakhmetov wrote: i use pipe() syscall from my program. when i compile it I got

Re: core.sys.posix.unistd link error

2013-09-22 Thread Ruslan Mullakhmetov
I found where the problem is. I used a system call (external C function) in class ctor. then I declared global variable of this class and INITIALZIED that variable inplace. If i move initalization in module static this() everything compiles. the code is: incorrect version:

Re: core.sys.posix.unistd link error

2013-09-22 Thread Ruslan Mullakhmetov
in that object file (if any). On Sunday, 22 September 2013 at 19:50:14 UTC, Dmitry Olshansky wrote: 22-Sep-2013 15:52, Ruslan Mullakhmetov пишет: I found where the problem is. I used a system call (external C function) in class ctor. then I declared global variable of this class and INITIALZIED

Re: core.sys.posix.unistd link error

2013-09-22 Thread Ruslan Mullakhmetov
Davis wrote: On Sunday, September 22, 2013 13:52:54 Ruslan Mullakhmetov wrote: But now i need to sort out what the difference between // global scope int a = 10; That directly initializes the variable at compile time, meaning that whatever is used to initialize the variable must be callable

core.sys.posix.unistd link error

2013-09-21 Thread Ruslan Mullakhmetov
i use pipe() syscall from my program. when i compile it I got the following msg: Error: pipe cannot be interpreted at compile time, because it has no available source code how can i fix it? dmd 2.063.2, Mac OS X

pass array of objects to spawn

2011-11-10 Thread Ruslan Mullakhmetov
std.concurrency; class Foo { } void worker( Foo[] data ) { //... } void main() { auto data = new Foo[10]; spawn( worker, data ); } P.S. I do need to create data in main thread and distribute it to child threads. -- BR, Ruslan Mullakhmetov

Re: pass array of objects to spawn

2011-11-10 Thread Ruslan Mullakhmetov
; } } void worker( shared(Foo)[] data ) { data[0].mutate(); //... } void main() { auto data = new shared(Foo)[10]; spawn( worker, data ); } -- BR, Ruslan Mullakhmetov

Re: pass array of objects to spawn

2011-11-10 Thread Ruslan Mullakhmetov
error thread.d(16): Error: cannot implicitly convert expression (data_) of type shared(Foo)[] to Foo[] -- BR, Ruslan Mullakhmetov

Re: pass array of objects to spawn

2011-11-10 Thread Ruslan Mullakhmetov
On 2011-11-11 02:48:52 +0400, Timon Gehr said: On 11/10/2011 11:00 PM, Ruslan Mullakhmetov wrote: On 2011-11-11 01:23:01 +0400, Timon Gehr said: class Foo { } void worker( shared(Foo[]) data_ ) { Foo[] data = cast() data_; // this cast is valid because data_ is never read from another