Re: Unexpected threads observed before main()

2021-02-28 Thread Keivan Shah via Digitalmars-d-learn
On Monday, 1 March 2021 at 06:50:42 UTC, rikki cattermole wrote: Do you still get them when you call your app like this? ./app --DRT-gcopt=parallel:0 Wow, Not getting with "--DRT-gcopt=parallel:0", Thanks a lot, didn't know GC had a parallel option that can be

Re: Unexpected threads observed before main()

2021-02-28 Thread rikki cattermole via Digitalmars-d-learn
Do you still get them when you call your app like this? ./app --DRT-gcopt=parallel:0

Unexpected threads observed before main()

2021-02-28 Thread Keivan Shah via Digitalmars-d-learn
I had recently updated my dmd version to latest, i.e from 2.076.1 (I know, sorry) to 2.095.0 and suddenly my code has started spawning extra threads which were not there before with no obvious reasons, after trying to simplify and identify the cause as much as possible, I have come up with

Re: Does reserve() preallocate for futher appends too?

2021-02-28 Thread Jack via Digitalmars-d-learn
On Monday, 1 March 2021 at 03:12:42 UTC, Adam D. Ruppe wrote: On Monday, 1 March 2021 at 03:07:19 UTC, Jack wrote: isn't clear for me if reserve() does preallocate memory so that that operator like arr ~= x can use previously allocate memory by reserve() or it's just used in slices like b =

Re: Does reserve() preallocate for futher appends too?

2021-02-28 Thread Adam D. Ruppe via Digitalmars-d-learn
On Monday, 1 March 2021 at 03:07:19 UTC, Jack wrote: isn't clear for me if reserve() does preallocate memory so that that operator like arr ~= x can use previously allocate memory by reserve() or it's just used in slices like b = arr[x .. y]? Slicing never allocates memory. reserve extends

Does reserve() preallocate for futher appends too?

2021-02-28 Thread Jack via Digitalmars-d-learn
isn't clear for me if reserve() does preallocate memory so that that operator like arr ~= x can use previously allocate memory by reserve() or it's just used in slices like b = arr[x .. y]?

Re: How do I check if a type is assignable to null at compile time?

2021-02-28 Thread Jack via Digitalmars-d-learn
On Saturday, 27 February 2021 at 01:23:06 UTC, H. S. Teoh wrote: On Sat, Feb 27, 2021 at 01:03:56AM +, Jack via Digitalmars-d-learn wrote: On Friday, 26 February 2021 at 23:37:18 UTC, Murilo wrote: > On Friday, 26 February 2021 at 05:25:14 UTC, Jack wrote: > > I started with: > > > > enum

Re: Name mangling problem with tiny Windows 10 load-time DLL example

2021-02-28 Thread WhatMeWorry via Digitalmars-d-learn
On Sunday, 28 February 2021 at 22:10:21 UTC, Siemargl wrote: On Sunday, 28 February 2021 at 18:29:11 UTC, WhatMeWorry wrote: It seems pretty obvious the problem is with name mangling. But how to fix it? fixing int numb = 1; and your example work correct ldc 1.24 / win10 P.S.I'm not

Re: Name mangling problem with tiny Windows 10 load-time DLL example

2021-02-28 Thread Siemargl via Digitalmars-d-learn
On Sunday, 28 February 2021 at 18:29:11 UTC, WhatMeWorry wrote: It seems pretty obvious the problem is with name mangling. But how to fix it? fixing int numb = 1; and your example work correct ldc 1.24 / win10 P.S.I'm not recommend using such keywords as 'file', may cross with other

Re: Name mangling problem with tiny Windows 10 load-time DLL example

2021-02-28 Thread Kagamin via Digitalmars-d-learn
mangleof should give _D4file6addOneFiZi, not _D6patron6addOneFiZi

Name mangling problem with tiny Windows 10 load-time DLL example

2021-02-28 Thread WhatMeWorry via Digitalmars-d-learn
It seems pretty obvious the problem is with name mangling. But how to fix it? -- module file; extern(D) export { int addOne(int i) { return (i + 1); } } -- module

Re: vibe.d selectively include attribute into tag using diet template

2021-02-28 Thread Steven Schveighoffer via Digitalmars-d-learn
On 2/28/21 12:29 AM, JG wrote: On Saturday, 27 February 2021 at 19:12:55 UTC, Steven Schveighoffer wrote: If you use an expression without quotes in diet, it becomes an interpolation. Would you mind explaining in more detail what this means? How could one use this, other than with booleans?

Re: How can I make this work?

2021-02-28 Thread Adam D. Ruppe via Digitalmars-d-learn
On Sunday, 28 February 2021 at 07:05:27 UTC, Jack wrote: I'm using a windows callback function where the user-defined value is passed thought a LPARAM argument type. I'd like to pass my D array then access it from that callback function. How is the casting from LPARAM to my type array done in

Re: dub git dependencies

2021-02-28 Thread Andre Pany via Digitalmars-d-learn
On Sunday, 28 February 2021 at 11:11:27 UTC, bogdan wrote: Hi, I remember that I saw a while ago some PRs related to adding a git url for a dependency in the dub's package.json. I looked today in the docs and I can't find any info about this. What is the progress for this feature? Can we use

dub git dependencies

2021-02-28 Thread bogdan via Digitalmars-d-learn
Hi, I remember that I saw a while ago some PRs related to adding a git url for a dependency in the dub's package.json. I looked today in the docs and I can't find any info about this. What is the progress for this feature? Can we use it already?

Re: How can I make this work?

2021-02-28 Thread rikki cattermole via Digitalmars-d-learn
On 28/02/2021 11:05 PM, Max Haughton wrote: Do the windows APIs expect the length in memory rather than as a parameter? This sounds like its being sent via a user field to be passed to a callback. I.e. event loop for a window. In this sort of case you only get one parameter on the callback

Re: How can I make this work?

2021-02-28 Thread Max Haughton via Digitalmars-d-learn
On Sunday, 28 February 2021 at 09:18:56 UTC, Rumbu wrote: On Sunday, 28 February 2021 at 09:04:49 UTC, Rumbu wrote: On Sunday, 28 February 2021 at 07:05:27 UTC, Jack wrote: I'm using a windows callback function where the user-defined value is passed thought a LPARAM argument type. I'd like to

Re: How can I make this work?

2021-02-28 Thread Rumbu via Digitalmars-d-learn
On Sunday, 28 February 2021 at 09:04:49 UTC, Rumbu wrote: On Sunday, 28 February 2021 at 07:05:27 UTC, Jack wrote: I'm using a windows callback function where the user-defined value is passed thought a LPARAM argument type. I'd like to pass my D array then access it from that callback

Re: How can I make this work?

2021-02-28 Thread Rumbu via Digitalmars-d-learn
On Sunday, 28 February 2021 at 07:05:27 UTC, Jack wrote: I'm using a windows callback function where the user-defined value is passed thought a LPARAM argument type. I'd like to pass my D array then access it from that callback function. How is the casting from LPARAM to my type array done in

Re: How can I make this work?

2021-02-28 Thread rikki cattermole via Digitalmars-d-learn
On 28/02/2021 8:05 PM, Jack wrote: int[] arr = [1, 2, 3]; size_t l = cast(size_t)arr.ptr; Okay, so far so good int[] a = cast(int[]) cast(void*) l; Umm, you haven't specified a length? int[] a = (cast(int*)l)[0 .. 3]; If the callback is being called (in effect under the current stack