Re: Erasing passwords from ram?

2019-05-06 Thread Dukc via Digitalmars-d-learn
Oops, I forgot to check back this theard. But yes, just the info I was looking for. On Wednesday, 1 May 2019 at 22:14:52 UTC, Cym13 wrote: There are very few relevant threat models where removing a password from RAM is an adequate solution. Not an adequate solution... What else is usually n

Re: Can't use threads

2019-05-06 Thread Ron Tarrant via Digitalmars-d-learn
On Saturday, 4 May 2019 at 22:29:26 UTC, Aldo wrote: i'm trying to run 3 threads with the following code : https://run.dlang.io/is/p4ThlD Works for me... Windows 10 Pro DMD 2.085.1 (-de -w -m64 switches) Note: I didn't use dub, so perhaps there's something going on there.

Re: Can't use threads

2019-05-06 Thread Aldo via Digitalmars-d-learn
On Monday, 6 May 2019 at 09:46:46 UTC, Ron Tarrant wrote: On Saturday, 4 May 2019 at 22:29:26 UTC, Aldo wrote: i'm trying to run 3 threads with the following code : https://run.dlang.io/is/p4ThlD Works for me... Windows 10 Pro DMD 2.085.1 (-de -w -m64 switches) Note: I didn't use dub, so p

Re: Compiler/Phobos/Types problem — panic level due to timing.

2019-05-06 Thread Russel Winder via Digitalmars-d-learn
On Sunday, 5 May 2019 at 19:34:05 UTC, Nicholas Wilson wrote: On Sunday, 5 May 2019 at 19:18:47 UTC, lithium iodate wrote: [...] Yep https://run.dlang.io/is/XsLrRz works for me, https://run.dlang.io/is/KxY0e9 doesn't. Thanks people. I now have a working code. :-)

__gshared 32 & 64 bit

2019-05-06 Thread Aldo via Digitalmars-d-learn
Hello, is there a difference between __gshared on 32 and 64 bit apps ? I have an IOCP app on windows that works correctly when compiled as 64 bit, but crash/block when compiled as 32 bit. Thanks.

Re: What are some ways to get more strict type-checking?

2019-05-06 Thread Adam D. Ruppe via Digitalmars-d-learn
On Monday, 6 May 2019 at 02:02:52 UTC, Devin wrote: But to my astonishment, the broken code compiled without any warnings or notifications. Yeah, I kinda wish bool (and char too, while we're at it) wouldn't implicitly convert to int. alias ID = uint; Since this is an alias, there is zero

alias this and struct allocation

2019-05-06 Thread faissaloo via Digitalmars-d-learn
I've been having some memory issues (referenced objects turning to nulls for no apparent reason) and I was wondering if I've misunderstood how allocation works when instantiating a struct that uses alias this: import std.stdio; struct Parent { int a;

Re: alias this and struct allocation

2019-05-06 Thread aliak via Digitalmars-d-learn
On Monday, 6 May 2019 at 14:48:56 UTC, faissaloo wrote: I've been having some memory issues (referenced objects turning to nulls for no apparent reason) and I was wondering if I've misunderstood how allocation works when instantiating a struct that uses alias this: import std.stdio;

Re: alias this and struct allocation

2019-05-06 Thread faissaloo via Digitalmars-d-learn
On Monday, 6 May 2019 at 15:17:37 UTC, aliak wrote: Do you have an example of a referenced object turning to null? We may be able to spot something Unfortunately I haven't managed to produce an example any smaller than my entire codebase

Re: alias this and struct allocation

2019-05-06 Thread Alex via Digitalmars-d-learn
On Monday, 6 May 2019 at 14:48:56 UTC, faissaloo wrote: I've been having some memory issues (referenced objects turning to nulls for no apparent reason) and I was wondering if I've misunderstood how allocation works when instantiating a struct that uses alias this: import std.stdio;

Re: alias this and struct allocation

2019-05-06 Thread Adam D. Ruppe via Digitalmars-d-learn
On Monday, 6 May 2019 at 14:48:56 UTC, faissaloo wrote: misunderstood how allocation works when instantiating a struct that uses alias this: alias this has no effect on allocation at all. All it does is if x.y doesn't compile, it rewrites it to x.alias_this.y (or if f(x) doesn't work, it tr

Re: Compiler/Phobos/Types problem — panic level due to timing.

2019-05-06 Thread John Colvin via Digitalmars-d-learn
On Monday, 6 May 2019 at 13:05:27 UTC, Russel Winder wrote: On Sunday, 5 May 2019 at 19:34:05 UTC, Nicholas Wilson wrote: On Sunday, 5 May 2019 at 19:18:47 UTC, lithium iodate wrote: [...] Yep https://run.dlang.io/is/XsLrRz works for me, https://run.dlang.io/is/KxY0e9 doesn't. Thanks peopl

Framework design, initialization and framework usage

2019-05-06 Thread Robert M. Münch via Digitalmars-d-learn
I want to build a framework which gives some structure to the app using it. To create this structure I would like to use interfaces. The application then uses these interfaces and implements the required functions. I want to provide a clear initialization sequence for the app through the framew

Re: What are some ways to get more strict type-checking?

2019-05-06 Thread H. S. Teoh via Digitalmars-d-learn
On Mon, May 06, 2019 at 02:41:31PM +, Adam D. Ruppe via Digitalmars-d-learn wrote: > On Monday, 6 May 2019 at 02:02:52 UTC, Devin wrote: > > But to my astonishment, the broken code compiled without any > > warnings or notifications. > > Yeah, I kinda wish bool (and char too, while we're at it

Re: Framework design, initialization and framework usage

2019-05-06 Thread Adam D. Ruppe via Digitalmars-d-learn
On Monday, 6 May 2019 at 16:50:14 UTC, Robert M. Münch wrote: myFramework mf = new myFramework; I'd make that thing's constructor private, and then offer a helper template function that actually creates it and the user passes a type. --- // inside your library struct myFramework {

Re: Framework design, initialization and framework usage

2019-05-06 Thread Robert M. Münch via Digitalmars-d-learn
On 2019-05-06 17:04:47 +, Adam D. Ruppe said: I'd make that thing's constructor private, and then offer a helper template function that actually creates it and the user passes a type. Any reason why makeing things private? The struct is more like an application state to avoid globals. And

Re: Erasing passwords from ram?

2019-05-06 Thread Cym13 via Digitalmars-d-learn
On Monday, 6 May 2019 at 09:34:22 UTC, Dukc wrote: Oops, I forgot to check back this theard. But yes, just the info I was looking for. On Wednesday, 1 May 2019 at 22:14:52 UTC, Cym13 wrote: There are very few relevant threat models where removing a password from RAM is an adequate solution.

Re: Run code before dub dependency's `shared static this()`

2019-05-06 Thread Jacob Carlborg via Digitalmars-d-learn
On 2019-05-05 14:52, Daniel N wrote: This might work: pragma(crt_constructor) extern(C) void early_init() { } Keep in mind that the D runtime is not full initialized at this point. -- /Jacob Carlborg

Re: Framework design, initialization and framework usage

2019-05-06 Thread Adam D. Ruppe via Digitalmars-d-learn
On Monday, 6 May 2019 at 18:03:18 UTC, Robert M. Münch wrote: Any reason why makeing things private? Just the constructor. It is so they don't try to skip a step calling the constructor themselves. But, of course, it doesn't have to be private. What I want to avoid is that explicit init li

Re: __gshared 32 & 64 bit

2019-05-06 Thread Jacob Carlborg via Digitalmars-d-learn
On 2019-05-06 15:43, Aldo wrote: Hello, is there a difference between __gshared on 32 and 64 bit apps ? Shouldn't be. I have an IOCP app on windows that works correctly when compiled as 64 bit, but crash/block when compiled as 32 bit. Do you have a reduced test case? Which compilers have y

Re: Framework design, initialization and framework usage

2019-05-06 Thread Jacob Carlborg via Digitalmars-d-learn
On 2019-05-06 20:03, Robert M. Münch wrote: What I want to avoid is that explicit init line in main(). So, the user should derive whatever make sense for the app, but main() is never touched by the user. main() should initialize the user's app code "automatically" and be part of the framework.

Meson build system user new to D.

2019-05-06 Thread Mike Brockus via Digitalmars-d-learn
Hello everyone I am a Meson build system user and I am new to the D language, just wondering if there are compiler flags that I should add, unit testing frameworks, any good practices I can follow and or anything like that also some resources would be helpful thanks. (: