GC: Understanding potential sources of false pointers

2017-04-19 Thread Nick Sabalausky (Abscissa) via Digitalmars-d-learn
According to : "Registers, the stack, and any other memory locations added through the GC.addRange function are always scanned conservatively." 1. Can that be safely assumed to be a canonical list of all possible sources of false pointers? 2. What

Windows X64 Calling conventions

2017-04-19 Thread Tofu Ninja via Digitalmars-d-learn
I am trying to learn the calling conventions in DMD, I am sure I will have more than one question about them so as I come across them I will ask them in this thread. I am mainly reading the MSDN docs on the x64 calls and looking at disassemblies to confirm what I learn. While I was looking

Re: Forwarding calls to objects of another type

2017-04-19 Thread Johan Fjeldtvedt via Digitalmars-d-learn
On Tuesday, 11 April 2017 at 02:01:19 UTC, Nicholas Wilson wrote: On Monday, 10 April 2017 at 21:27:34 UTC, Basile B. wrote: 2) This is about the reduce templates. As I've commented, I can't use a template lambda with reduce, but I can use a lambda taking ints as arguments. Why is this? The

Re: Forwarding calls to objects of another type

2017-04-19 Thread Johan Fjeldtvedt via Digitalmars-d-learn
On Monday, 10 April 2017 at 21:27:34 UTC, Basile B. wrote: On Monday, 10 April 2017 at 21:04:10 UTC, Johan Fjeldtvedt wrote: [...] One way: [...] Thanks for the reply. The traits way of doing it seems to be what I want. :) [...] [...]

Re: Can we disallow appending integer to string?

2017-04-19 Thread Stanislav Blinov via Digitalmars-d-learn
On Wednesday, 19 April 2017 at 18:40:23 UTC, H. S. Teoh wrote: A few extra keystrokes to type cast(int) or cast(char) ain't gonna kill nobody. In fact, it might even save a few people by preventing certain kinds of bugs. Yup. Not to mention one could have @property auto

Re: Can we disallow appending integer to string?

2017-04-19 Thread H. S. Teoh via Digitalmars-d-learn
On Wed, Apr 19, 2017 at 05:56:18PM +, Stanislav Blinov via Digitalmars-d-learn wrote: > On Wednesday, 19 April 2017 at 17:34:01 UTC, Jonathan M Davis wrote: > > Personally, I think that we should have taken the stricter approach > > and not had integral types implicit convert to character

Re: Stuck with DMD, and Unit-Threaded

2017-04-19 Thread Atila Neves via Digitalmars-d-learn
On Tuesday, 18 April 2017 at 07:07:16 UTC, Russel Winder wrote: On Mon, 2017-04-17 at 22:56 +, Atila Neves via Digitalmars-d-learn wrote: […] https://github.com/russel/ApproxGC/pull/2 Unfortunately the auto generated integration test main file doesn't quite work (feel free to file a

Re: Can we disallow appending integer to string?

2017-04-19 Thread Stanislav Blinov via Digitalmars-d-learn
On Wednesday, 19 April 2017 at 17:34:01 UTC, Jonathan M Davis wrote: Personally, I think that we should have taken the stricter approach and not had integral types implicit convert to character types, but from what I recall, Walter feels pretty strongly about the conversion rules being the

Re: Can we disallow appending integer to string?

2017-04-19 Thread Jonathan M Davis via Digitalmars-d-learn
On Wednesday, April 19, 2017 14:50:38 Stanislav Blinov via Digitalmars-d- learn wrote: > On Wednesday, 19 April 2017 at 14:36:13 UTC, Nick Treleaven wrote: > > This bug is fixed as the code no longer segfaults but throws > > instead: > > https://issues.dlang.org/show_bug.cgi?id=5995 > > > > void

Re: The app hanging after reach 1750MB of RAM

2017-04-19 Thread Stanislav Blinov via Digitalmars-d-learn
On Wednesday, 19 April 2017 at 07:28:32 UTC, Suliman wrote: 1. You're measuring it wrong. Array length is already measured in terms of type size. So should I do: cargpspoints.length * cargpspoints[0].sizeof ? No. .sizeof is the statically known size of a type, it can't take into account

Re: The app hanging after reach 1750MB of RAM

2017-04-19 Thread Suliman via Digitalmars-d-learn
On Wednesday, 19 April 2017 at 15:18:32 UTC, crimaniak wrote: On Tuesday, 18 April 2017 at 11:43:24 UTC, Suliman wrote: I am writing app that extract data from DB to array of structures. void getSingleTrackInfo() { foreach(item;

Re: The app hanging after reach 1750MB of RAM

2017-04-19 Thread crimaniak via Digitalmars-d-learn
On Tuesday, 18 April 2017 at 11:43:24 UTC, Suliman wrote: I am writing app that extract data from DB to array of structures. void getSingleTrackInfo() { foreach(item; getTablesGPSSensorList) { ResultRange

Re: Can we disallow appending integer to string?

2017-04-19 Thread Stanislav Blinov via Digitalmars-d-learn
On Wednesday, 19 April 2017 at 14:36:13 UTC, Nick Treleaven wrote: This bug is fixed as the code no longer segfaults but throws instead: https://issues.dlang.org/show_bug.cgi?id=5995 void main(){ string ret; int i = -1; ret ~= i; } Why is it legal to append an integer?

Can we disallow appending integer to string?

2017-04-19 Thread Nick Treleaven via Digitalmars-d-learn
This bug is fixed as the code no longer segfaults but throws instead: https://issues.dlang.org/show_bug.cgi?id=5995 void main(){ string ret; int i = -1; ret ~= i; } Why is it legal to append an integer?

Re: The app hanging after reach 1750MB of RAM

2017-04-19 Thread Suliman via Digitalmars-d-learn
I have added GC.stat https://dlang.org/library/core/memory/gc.stats.html here the result: freeSize: 49698640 | usedSize: 170502320 freeSize: 41174592 | usedSize: 217823680 freeSize: 53868576 | usedSize: 247072736 freeSize: 86494800 | usedSize: 307769776 freeSize: 58176640 | usedSize:

Re: The app hanging after reach 1750MB of RAM

2017-04-19 Thread Suliman via Digitalmars-d-learn
auto mymem = cargpspoints.length * typeof(cargpspoints[0]).sizeof; writeln(mymem); And it's print: 16963440 it's about 16MB... What is takes all other memory? 1. You're measuring it wrong. Array length is already measured in terms of type size. So should I do: cargpspoints.length *