Re: Usage of memory by arrays

2018-04-05 Thread unDEFER via Digitalmars-d
So, I completely found all answers. In my game of 260 Mb: 100 Mb consumes GC, 100 Mb consumes scene in glNewList. And 30 Mb textures in glTexImage2D. Very well, now I know what to do and how to get it smaller. Big thanks to all.

Re: Usage of memory by arrays

2018-04-05 Thread unDEFER via Digitalmars-d
On Thursday, 5 April 2018 at 22:23:12 UTC, Steven Schveighoffer wrote: 1. Compare to C malloc-ing 1.2MB at once (GC uses C malloc underneath) Yes after initialize malloc'ed 1.2Mb in C it consumes 1.6 Mb. 4.8 Mb => 4.9 Mb 2. Have you examined smaller numbers for total? Does it scale linearly

Re: Usage of memory by arrays

2018-04-05 Thread unDEFER via Digitalmars-d
On Thursday, 5 April 2018 at 22:06:10 UTC, Jonathan M Davis wrote: You could also look at how x.capacity compares to x.length as well as core.memory.GC.stats() to see what the GC thinks that it's using. On my system, the x.capacity was only 9 greater than x.length, and GC.stats printed as Ye

Re: Usage of memory by arrays

2018-04-05 Thread unDEFER via Digitalmars-d
OK, without reallocation: 8< void main() { float[3] f; float[3][] x; writefln("float = %s bytes", float.sizeof); writefln("float[3] = %s bytes", f.sizeof); int before = MemoryUsage(); int total = 100; x = new float[3][total*100

Re: Usage of memory by arrays

2018-04-05 Thread unDEFER via Digitalmars-d
On Thursday, 5 April 2018 at 21:11:53 UTC, Steven Schveighoffer wrote: But the old block doesn't go away! It's collected and stored in a free list for future allocations. -Steve Big thanks, -Steve! Really program like the next: ==8<== void main() { float[3] f;

Usage of memory by arrays

2018-04-05 Thread unDEFER via Digitalmars-d
Hello! Here very simple test program: --->8 import std.conv; import std.stdio; import std.string; int MemoryUsage() { auto file = File("/proc/self/status"); foreach (line; file.byLine()) { if (line[0..6] == "VmRSS:") { r

Re: regex(q"<[^]>")

2017-07-19 Thread unDEFER via Digitalmars-d
On Wednesday, 19 July 2017 at 16:59:24 UTC, Dmitry Olshansky wrote: On Monday, 17 July 2017 at 17:00:10 UTC, unDEFER wrote: Please file at: issues.dlang.org Thanks! --- Dmitry Olshansky Thank you, https://issues.dlang.org/show_bug.cgi?id=17668 https://issues.dlang.org/show_bug.cgi?id=17667

Re: regex(q"<[^]>")

2017-07-18 Thread unDEFER via Digitalmars-d
On Tuesday, 18 July 2017 at 08:56:12 UTC, Anton Fediushin wrote: Not a bug, but I think that `regex()` should fail with a nice exception, not silently fail. Yes, exception, not assert.

Re: regex(q"<[^]>")

2017-07-17 Thread unDEFER via Digitalmars-d
On Monday, 17 July 2017 at 20:43:29 UTC, unDEFER wrote: Sorry, fixed in the newest DMD also as the other bug in regex... Oh, no. Not fixed. Fixed only other bug.

Re: regex(q"<[^]>")

2017-07-17 Thread unDEFER via Digitalmars-d
Sorry, fixed in the newest DMD also as the other bug in regex...

regex(q"<[^]>")

2017-07-17 Thread unDEFER via Digitalmars-d
Hello! The code in the header leads to assertion! But the user inputed data don't must leads to any assertions!

Re: How to write Good IDE?

2017-02-05 Thread unDEFER via Digitalmars-d
On Sunday, 5 February 2017 at 17:11:02 UTC, MGW wrote: On Sunday, 5 February 2017 at 16:16:42 UTC, unDEFER wrote: On Sunday, 5 February 2017 at 14:37:48 UTC, MGW wrote: Can't load libQtE5Widgets64.so from current directory. Tried $ export LD_LIBRARY_PATH=`pwd`; ./ide5 -i pr1.ini $ export LIBR

Re: How to write Good IDE?

2017-02-05 Thread unDEFER via Digitalmars-d
On Sunday, 5 February 2017 at 14:37:48 UTC, MGW wrote: On Sunday, 5 February 2017 at 10:43:38 UTC, unDEFER wrote: $ dmd ide5 qte5 qte5prs asc1251 ini -release -m64 ide5.d(130): Error: undefined identifier 'Highlighter', did you mean variable 'highlighter'? Скорее всего qte5.d взята из примеров

Re: How to write Good IDE?

2017-02-05 Thread unDEFER via Digitalmars-d
On Sunday, 5 February 2017 at 09:20:36 UTC, MGW wrote: // Compile executable ide5 for 64 // Компилируем для 64 разрядного варианта dmd ide5 qte5 qte5prs asc1251 ini -release -m64 $ dmd ide5 qte5 qte5prs asc1251 ini -release -m64 ide5.d(130): Error: undefined identifier 'Highlighter', did you

Re: How to write Good IDE?

2017-02-04 Thread unDEFER via Digitalmars-d
On Friday, 3 February 2017 at 19:17:54 UTC, MGW wrote: On Wednesday, 1 February 2017 at 15:12:42 UTC, unDEFER wrote: And what important for you for Good IDE? Simple IDE. It is possible that that is useful from this what is. I permanently use it as it is very quickly. https://www.youtube.com

Re: How to write Good IDE?

2017-02-03 Thread unDEFER via Digitalmars-d
On Friday, 3 February 2017 at 12:37:53 UTC, Jacob Carlborg wrote: The old Eclipse plugin for D1, Descent [1], is the gold standard when it comes to IDE's for D. Check the features list [2] to get some ideas and inspiration. [1] http://www.dsource.org/projects/descent [2] http://www.dsource.org

Re: How to write Good IDE?

2017-02-02 Thread unDEFER via Digitalmars-d
On Friday, 3 February 2017 at 01:31:03 UTC, Chris Wright wrote: It's awkward to use dmdfe as a library, mainly because it's not vetted to work with the GC. You *can* disable the GC, invoke dmdfe, copy out the data you need, and then enable the GC. Thank you Chris, really I don't want use dmd

Re: How to write Good IDE?

2017-02-02 Thread unDEFER via Digitalmars-d
On Thursday, 2 February 2017 at 15:04:10 UTC, Jack Stouffer wrote: Speed. Yes, speed it will one of the main characteristic of my IDE.

How to write Good IDE?

2017-02-01 Thread unDEFER via Digitalmars-d
Hello! So my unDE 0.2.0 is released (http://forum.dlang.org/thread/yzfthfipouzhejfsk...@forum.dlang.org), and this means that the time to write unDE 0.3.0 - text editor and IDE. And I grab my head when thinking how much I want to implement. 1) It must shows unused modules 2) It must shows part

Re: bdb2d and openSUSE

2017-01-25 Thread unDEFER via Digitalmars-d
So, the problem: $ cc --version cc (SUSE Linux) 4.8.3 20140627 [gcc-4_8-branch revision 212064] Copyright (C) 2013 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

bdb2d and openSUSE

2017-01-24 Thread unDEFER via Digitalmars-d
Hello! Trying to build my project for Open SuSE and my project bdb2d unexpectedly brings error: Linking... ../../.dub/packages/bdb2d-5.3.28/bdb2d/.dub/build/library-debug-linux.posix-x86_64-dmd_2071-9E956773380BE684D56F8F1619A72458/libdb.a(db_126_1b8.o): In function `_D10berkeleydb2db2Db6__cto

Re: Hangs on toStringZ()

2016-12-28 Thread unDEFER via Digitalmars-d
On Wednesday, 28 December 2016 at 12:39:46 UTC, Nemanja Boric wrote: Right, nothing wrong with threads, but super tricky to combine it with fork. So, it could be that one of your threads is using GC at the point of the forking, so it keeps the GC locked. Now you fork, and _all your threads don'

Re: Hangs on toStringZ()

2016-12-28 Thread unDEFER via Digitalmars-d
On Wednesday, 28 December 2016 at 11:32:09 UTC, Nemanja Boric wrote: My other guess is that you're using D threads in your application? Of course I'm using D threads, but with it all is normally.

Re: Hangs on toStringZ()

2016-12-28 Thread unDEFER via Digitalmars-d
On Wednesday, 28 December 2016 at 11:30:22 UTC, Nemanja Boric wrote: What you should do is following: 1. Allocate all needed data, convert all D strings into C strings, etc. 2. fork 3. exec immediately, not using anything from standard library between 2 and 3. OK, thank you.. I'm trying it

Re: Hangs on toStringZ()

2016-12-27 Thread unDEFER via Digitalmars-d
On Tuesday, 27 December 2016 at 21:33:46 UTC, Marc Schütz wrote: What context are you calling this from? Is this in a signal handler? Or from inside a destructor of a GC-owned object? It is child of my process after fork and before execl. No signal handler, no destructor, no catch-block, usua

Re: Hangs on toStringZ()

2016-12-27 Thread unDEFER via Digitalmars-d
The last backtrace shows that it hangs on the line: immutable(char) *bash = "/bin/bash".toStringz();

Re: Hangs on toStringZ()

2016-12-27 Thread unDEFER via Digitalmars-d
On Tuesday, 27 December 2016 at 18:01:36 UTC, Stefan Koch wrote: Have you tried assigning it to a variable ? Yes, I have tried, now backtrace of hanged process is: (gdb) bt #0 0x7f4e18260c6d in ?? () #1 0x in ?? ()

Re: Hangs on toStringZ()

2016-12-27 Thread unDEFER via Digitalmars-d
On Tuesday, 27 December 2016 at 17:50:14 UTC, Stefan Koch wrote: The string is allocated on the gc-ed heap. And since it's an R value it might get destroyed before execl is finished. Assign the result of toStringz to a char* variable and use that in the call. But execl not goes to Seg.fault.

Re: Using dlopen/dlsym

2016-12-27 Thread unDEFER via Digitalmars-d
It works on my Ubuntu 16.04 and dmd v2.071.1 But it wants to call dlopen() as core.sys.posix.dlfcn.dlopen().

Hangs on toStringZ()

2016-12-27 Thread unDEFER via Digitalmars-d
Hello I have very simple line with exec-command: execl("/bin/bash".toStringz(), "/bin/bash".toStringz(), "-c".toStringz(), command.toStringz(), null); And on this line on toStringz my program sometimes hangs. backtrace: (gdb) bt #0 0x7f3acd535c6d in nanosleep () at ../sysdeps/unix/sysca

Re: D with CygWin

2016-12-06 Thread unDEFER via Digitalmars-d
So it was not finish :-( mkdir("C:\\cygwin\\home\\undefer\\TEST") is working mkdir("/home/undefer/TEST") creates directory and hangs, doesn't pass control to the next instruction. DirEntry("/") works in my simple program, but doesn't work in big program.. windbg, gdb doen't help at all. It

Re: D with CygWin

2016-12-04 Thread unDEFER via Digitalmars-d
DONE!!! === $ cat try.d import std.stdio; import std.string; import cygwin.std.file; import cygwin.loader; void main() { CygwinInit(); foreach (string name; dirEntries("/", SpanMode.shallow)) { writefln(name); }

Re: D with CygWin

2016-12-04 Thread unDEFER via Digitalmars-d
I have found. I have to use cygwin_dll_init == $ cat try.d import std.stdio; import std.string; import core.sys.windows.windows; extern(C) { alias int function(const (char)*, int, ...) open_t; alias void function() init_t; alias void functi

Re: D with CygWin

2016-12-03 Thread unDEFER via Digitalmars-d
So, just another attempt.. = import std.stdio; import std.string; import core.sys.windows.winbase; extern(C) { alias int function(in char*, int, ...) open_t; open_t _my_open; extern uint errno; } void main() { writefln("Open Li

Re: OT: for (;;) {} vs while (true) {}

2016-11-24 Thread unDEFER via Digitalmars-d
Why you consider only 2 options? Use "do {} while (true);" :-)

Re: Detect that a child is waiting for input

2016-11-24 Thread unDEFER via Digitalmars-d
The program which stops even run without "&": #!/usr/bin/rdmd import std.stdio; import std.file; import std.string; import core.sys.posix.unistd; import core.stdc.errno; import core.stdc.string; void main() { int res = core.sys.posix.unistd.tcsetpgrp(0, getppid()); if (res != 0) {

Re: Detect that a child is waiting for input

2016-11-24 Thread unDEFER via Digitalmars-d
Here is good information about difference between foreground process groups and background: https://www.win.tue.nl/~aeb/linux/lk/lk-10.html Shortly, there is only one process group which is foreground, you can get it with tcgetpgrp(fd) or set it with tcsetpgrp(fd,pgrp). To setup process group

Re: Detect that a child is waiting for input

2016-11-24 Thread unDEFER via Digitalmars-d
On Wednesday, 23 November 2016 at 07:18:27 UTC, Shachar Shemesh wrote: The shell does that for background processes. I think it takes away the TTY from its children, and this way, when they try to read from stdin, they get SIGSTOP from the system. I'm not sure what the precise mechanism is.

Re: Detect that a child is waiting for input

2016-11-23 Thread unDEFER via Digitalmars-d
On Wednesday, 23 November 2016 at 20:02:08 UTC, wobbles wrote: You could wait for some period of time - and if that's passed and the child hasn't printed anything you can assume it's waiting for input. Yes, I also have thought about it, thank you.

Re: Detect that a child is waiting for input

2016-11-23 Thread unDEFER via Digitalmars-d
On Wednesday, 23 November 2016 at 07:18:27 UTC, Shachar Shemesh wrote: The shell does that for background processes. I think it takes away the TTY from its children, and this way, when they try to read from stdin, they get SIGSTOP from the system. I'm not sure what the precise mechanism is. T

Re: Detect that a child is waiting for input

2016-11-23 Thread unDEFER via Digitalmars-d
On Tuesday, 22 November 2016 at 22:30:06 UTC, wobbles wrote: Easier said than done as there's no signal the child sends to say "OK, I'm waiting now". You can use expect to do this, if you know what the output of the child will be just before it's waiting for IO. This is the D lib I've writte

Re: D with CygWin

2016-11-23 Thread unDEFER via Digitalmars-d
On Tuesday, 22 November 2016 at 15:00:44 UTC, Adam D. Ruppe wrote: On Monday, 21 November 2016 at 06:38:00 UTC, unDEFER wrote: 1) recompile all dmd libraries including snn.lib with replacing open->_open, close->_close, remove->_remove. What if you just wrote wrapper functions or better yet, li

Re: Detect that a child is waiting for input

2016-11-20 Thread unDEFER via Digitalmars-d
On Sunday, 20 November 2016 at 21:03:57 UTC, John Colvin wrote: If blocking is an error, you could close stdin and assuming the process checks the error codes correctly No, I mean blocking is not error. One method to find it, run gdb or strace and see where the process stopped, or which sy

Re: D with CygWin

2016-11-20 Thread unDEFER via Digitalmars-d
On Monday, 21 November 2016 at 04:06:31 UTC, rikki cattermole wrote: No, snn.lib is the exact thing that you don't need. I need to resolve conflict between snn.lib and cygwin1.dll. And I can see only 2 methods: 1) recompile all dmd libraries including snn.lib with replacing open->_open, close-

Re: D with CygWin

2016-11-20 Thread unDEFER via Digitalmars-d
On Sunday, 20 November 2016 at 14:39:24 UTC, Mike Parker wrote: Not impossible. It's just going to require some backend work. It's not something you can make happen from the command line. Possible of course.. But looks like it needed at least snn.lib sources and maybe something more.

Detect that a child is waiting for input

2016-11-20 Thread unDEFER via Digitalmars-d
Hello! I'm using pipeProcess() to create a process: pipes = pipeProcess(["bash", "-c", BASH_COMMAND], Redirect.stdin | Redirect.stdout | Redirect.stderr); Is it possible detect that the child is waiting for input on stdin? I can't find decision even for C. I think it is impossible if the chi

Re: D with CygWin

2016-11-20 Thread unDEFER via Digitalmars-d
On Friday, 18 November 2016 at 17:33:41 UTC, unDEFER wrote: Wow, Thank you! I have bought. I'm waiting instructions for download. Google is a stranger to fear: it have sent to spam the message from Walter Bright himself! Walter prompt to me LIB.EXE utility, and I have removed from snn.lib "io

Re: D with CygWin

2016-11-18 Thread unDEFER via Digitalmars-d
On Friday, 18 November 2016 at 16:53:02 UTC, Adam D. Ruppe wrote: On Friday, 18 November 2016 at 16:40:14 UTC, unDEFER wrote: Where snn.lib sources??? http://digitalmars.com/shop.html It is considered part of the proprietary compiler source. You can't build it yourself without buying a licen

Re: D with CygWin

2016-11-18 Thread unDEFER via Digitalmars-d
So, I know now, that dmd, druntime and phobos are three different repositories... I have compiled druntime, phobos, but never found snn.lib. Where snn.lib sources???

Re: D with CygWin

2016-11-18 Thread unDEFER via Digitalmars-d
So, I seems need to rebuild dmd, exactly snn.lib without open/remove/close. Now I have the next error: $ make -fwin32.mak cd src make -f win32.mak auto-tester-build make -fwin32.mak C=backend TK=tk ROOT=root MAKE="make" HO

Re: D with CygWin

2016-11-18 Thread unDEFER via Digitalmars-d
So.. I have changed my cygwin/core/sys/posix/config.d enum _FILE_OFFSET_BITS = 64; to enum _FILE_OFFSET_BITS = 32; and now I have only these 3 problems: === $ dmd `find . -iname "*.d"` C:\\cygwin\\bin\\Cygwin1.lib OPTLINK (R) for Win32 Release 8.00.17 Copyrig

Re: D with CygWin

2016-11-18 Thread unDEFER via Digitalmars-d
On Friday, 18 November 2016 at 10:43:09 UTC, unDEFER wrote: Error 1: Previous Definition Different : _close Error 1: Previous Definition Different : _remove Also there is these 2 problem. How to make linker to choose functions from cygwin.dll and ignore other definitions?

Re: D with CygWin

2016-11-18 Thread unDEFER via Digitalmars-d
On Friday, 18 November 2016 at 10:54:52 UTC, Stefan Koch wrote: You have to link with the cygwin.dll to get the symbols. That is not not done by default I presume. Look attentive, I have done on the last message, cygwin1.lib, which I have created with implib. But 64-bit functions was not foun

Re: D with CygWin

2016-11-18 Thread unDEFER via Digitalmars-d
Look again, now there is only 5 not defined symbols: $ dmd `find . -iname "*.d"` C:\\cygwin\\bin\\Cygwin1.lib OPTLINK (R) for Win32 Release 8.00.17 Copyright (C) Digital Mars 1989-2013 All rights reserved. http://www.digitalmars.com/ctg/optlink.html C:\D\dmd2\window

Re: D with CygWin

2016-11-18 Thread unDEFER via Digitalmars-d
On Friday, 18 November 2016 at 10:04:28 UTC, Daniel Kozak wrote: No it does not require it. Your error seems like you do not links against your cygwin stdio, where do you place your cygwin.std.* files? Did you rename module std.whatever to module cygwin.std.whatever ? Oh, you are right, it is

Re: D with CygWin

2016-11-18 Thread unDEFER via Digitalmars-d
On Friday, 18 November 2016 at 09:33:58 UTC, unDEFER wrote: === $ dmd try.d OPTLINK (R) for Win32 Release 8.00.17 Copyright (C) Digital Mars 1989-2013 All rights reserved. http://www.digitalmars.com/ctg/optlink.html try.obj(try) Error 42: Symbol Undefined _D6cygwin

Re: D with CygWin

2016-11-18 Thread unDEFER via Digitalmars-d
On Friday, 18 November 2016 at 09:40:25 UTC, rikki cattermole wrote: Perhaps you should treat it as a port to a new platform. So start with getting druntime going (which means recompiling it). No, no recompile. The idea is very simple: 1. The cygwin provides libraries 2. I can rewrite dirEntri

Re: D with CygWin

2016-11-18 Thread unDEFER via Digitalmars-d
Hello, again! I'm long have thought and have decided to try to do the next thing: I'm trying to list "/" of cygwin environment with the next code: === import std.stdio; import cygwin.std.file; void main() { foreach (string name; dirEntries("/", SpanMode.shal

Re: send doesn't work

2016-11-17 Thread unDEFER via Digitalmars-d
On Wednesday, 16 November 2016 at 20:20:07 UTC, Anonymouse wrote: receiveTimeout(0.seconds, /* ... */ ); Thanks!

Re: send doesn't work

2016-11-16 Thread unDEFER via Digitalmars-d
On Wednesday, 16 November 2016 at 10:54:32 UTC, Era Scarecrow wrote: I just have to wonder every time I look at this... how long is 1 hnsecs? I'd assume not very long. Either blocking unless there's no more messages, or having a longer timeout period seems a better bet. Might make it 1-5ms.

Re: send doesn't work

2016-11-16 Thread unDEFER via Digitalmars-d
On Tuesday, 15 November 2016 at 20:46:59 UTC, Steven Schveighoffer wrote: From experience, this smells like a race condition. And I have found the error! And you are right! It is really race condition. The problem was that I had not one receiveTimeout() but 3 receiveTimeout() for each threa

Re: send doesn't work

2016-11-16 Thread unDEFER via Digitalmars-d
Really situation is much more interesting: Sometimes I got Tid not the same as sent. Sometimes I receive 2 TID although sent only 1.

Re: send doesn't work

2016-11-15 Thread unDEFER via Digitalmars-d
On Tuesday, 15 November 2016 at 18:23:16 UTC, Steven Schveighoffer wrote: 1. I'm sure it's not "magic" but likely something you are missing. 2. Nobody here can help you without a working demonstration. i.e., this isn't a known issue, and others have used the concurrency subsystem without such p

Re: send doesn't work

2016-11-15 Thread unDEFER via Digitalmars-d
On Tuesday, 15 November 2016 at 18:11:38 UTC, Daniel Kozak wrote: Yous should post this into Learn news group not in General. And it would be better if you provided full (not)working example. If the problem will appears again I will try to make short not working example.. and I guess you h

Re: send doesn't work

2016-11-15 Thread unDEFER via Digitalmars-d
On Tuesday, 15 November 2016 at 18:12:32 UTC, Steven Schveighoffer wrote: Without more complete code, it's difficult to say what is happening. -Steve Code is big. I of course can return to the question when the code will available on the git. But now it is not available.

Re: send doesn't work

2016-11-15 Thread unDEFER via Digitalmars-d
Now I'm sending "hello"-message from child thread in the loop every iteration, and the last message again working. What the magic??? The send-subsystem "becomes rotten" if don't use it???

send doesn't work

2016-11-15 Thread unDEFER via Digitalmars-d
Hello! In my thread I'm sending the Tid of the thread to the parent to inform it about finishing: send(tid, thisTid); The parent thread has the next code to receive it and handle: receiveTimeout( dur!"hnsecs"(1), (Tid tid) {//the message from child thread handler

Re: D with CygWin

2016-11-14 Thread unDEFER via Digitalmars-d
On Monday, 14 November 2016 at 12:36:53 UTC, Chris wrote: It is. I'd recommend MinGW, though. Else you will have to ship the cygwin.dll. However, you can compile your D app directly on windows with dmd/dub, depending on the app. What kinda application is it? I still think how to better port m

D with CygWin

2016-11-14 Thread unDEFER via Digitalmars-d
Hello! I want to port my D application to Windows using CygWin. Is it possible? How?

Re: pipeProcess: read stdout and stderror simultaneously

2016-11-13 Thread unDEFER via Digitalmars-d
I have found! The magic word is Redirect.stderrToStdout. So the right code: == auto rsync_pipes = pipeProcess(["rsync", archieve_option, "-vu", "--delete", path, copy_to], Redirect.stdout | Redirect.stderrToStdout); scope(exit) wait(df_pipes.pid); foreach (df_line; df_pipes.stdout.by

Re: pipeProcess: read stdout and stderror simultaneously

2016-11-13 Thread unDEFER via Digitalmars-d
2) Some magic function which join stderr with stdout together: foreach (df_line; df_pipes.stdout_joined_with_stderr.notBlockingByLine) { //Handle progress } Thank you in advance.

pipeProcess: read stdout and stderror simultaneously

2016-11-13 Thread unDEFER via Digitalmars-d
Hello! I'm trying to run rsync and handle errors and operation progress at the same time: auto rsync_pipes = pipeProcess(["rsync", "-avu", "--delete", path, copy_to], Redirect.stdout | Redirect.stderr); scope(exit) wait(df_pipes.pid); foreach (df_line; df_pipes.stdout.by

Re: Strange destructors' call order

2016-09-30 Thread unDEFER via Digitalmars-d
On Friday, 30 September 2016 at 21:22:57 UTC, Adam D. Ruppe wrote: If you need destructor ordering, use structs or explicit create and destroy calls. Thank you. destroy(gs) working good for me.

Strange destructors' call order

2016-09-30 Thread unDEFER via Digitalmars-d
Hello again! I have strange destructors' call order in the next code: $ cat dub.json =8<= { "name": "test", "dependencies": { "bdb2d": ">=5.3.28", } } =>8= $ cat source/mai

Re: dub: Detected dependency cycle

2016-09-29 Thread unDEFER via Digitalmars-d
On Thursday, 29 September 2016 at 10:41:49 UTC, Sönke Ludwig wrote: The problem appears to be that both packages are called "bdb2d", so they are considered as the same package - or in particular the dependency to "bdb2d" in the second package is considered as a reference to itself. OMG, reall

Re: dub: Detected dependency cycle

2016-09-29 Thread unDEFER via Digitalmars-d
Forgot to say: dub normally builds my bdb2d from it's directory. It doesn't detects any dependency cycle on targets "bdb2d", "bdb2d:reader", "bdb2d:writer".

dub: Detected dependency cycle

2016-09-29 Thread unDEFER via Digitalmars-d
Hello! Finally I have added my bdb2d package to dub. But something is going wrong and when I'm trying to use my own pakcage it say me: $ dub Detected dependency cycle: bdb2d->bdb2d dub.json from bdb2d: { "name": "bdb2d", "targetName": "db", "targetType": "library", "description"

Re: DerelictSDL2 crashes

2016-08-28 Thread unDEFER via Digitalmars-d
On Sunday, 28 August 2016 at 00:53:45 UTC, Mike Parker wrote: On Saturday, 27 August 2016 at 16:08:49 UTC, unDEFER wrote: dub --help Run "dub --help" to get help for a specific command. Thank you

Re: DerelictSDL2 crashes

2016-08-27 Thread unDEFER via Digitalmars-d
On Saturday, 27 August 2016 at 14:49:51 UTC, rikki cattermole wrote: $ dub build --help Yes, but how get knoledge from `dub --help` that `dub build --help` also available?

Re: DerelictSDL2 crashes

2016-08-27 Thread unDEFER via Digitalmars-d
On Saturday, 27 August 2016 at 14:23:13 UTC, unDEFER wrote: How to make dub working with gdc? Wow, it is so easy: $ dub --compiler=gdc But it is not documentated feature in --help.. So strange..

Re: DerelictSDL2 crashes

2016-08-27 Thread unDEFER via Digitalmars-d
I have tried to compile with gdc compiler: $ gdc -I /path/to/DerelictSDL2/source/ -I /path/to/derelict-util-2.0.6/source/ source/main.d /path/to/DerelictSDL2/source/derelict/sdl2/* /path/to/derelict-util-2.0.6/source/derelict/util/* /usr/lib/i386-linux-gnu/libdl.so And it is working fine. H

Re: DerelictSDL2 crashes

2016-08-27 Thread unDEFER via Digitalmars-d
So, what I think? Looks like I have corrupted stack, so any operation on the first word of the stack makes error. I have i386 architecture. Could this be a compiler bug?

Re: DerelictSDL2 crashes

2016-08-27 Thread unDEFER via Digitalmars-d
I have fixed the error by replacing: Uint32 __attribute__((aligned(16))) [4]; with: Uint32 __attribute__((aligned(16))) ccc[5]; Uint32 * = ccc+1; After this it falls in other place: SDL_Rect real_srcrect = { 0, 0, 0, 0 }; The same code on C works fine. I really don't kn

Re: DerelictSDL2 crashes

2016-08-27 Thread unDEFER via Digitalmars-d
Thank you for testing my code and for help with dub. I have rebuilt SDL2 from source. Unwrapped macroses and found that the error in the next code: __m128 c128; Uint32 __attribute__((aligned(16))) [4]; [0] = color; // THE ERROR IS HERE [1] = color; [2] = colo

DerelictSDL2 crashes

2016-08-26 Thread unDEFER via Digitalmars-d
Hello! I'm trying compile SDL "Hello, World" --- import std.stdio; import derelict.sdl2.sdl; //Screen dimension constants const int SCREEN_WIDTH = 640; const int SCREEN_HEIGHT = 480; int main() { DerelictSDL2.load(); //The window we'll be rendering to SDL_Window* window =