Re: Real simple unresolved external symbols question...

2021-02-10 Thread kinke via Digitalmars-d-learn
On Thursday, 11 February 2021 at 00:18:23 UTC, H. S. Teoh wrote: On Wed, Feb 10, 2021 at 11:35:27PM +, WhatMeWorry via Digitalmars-d-learn wrote: [...] Okay, thanks. Then why does the README.md at https://github.com/dlang/druntime say "Runtime is typically linked together with Phobos in a

Re: Real simple unresolved external symbols question...

2021-02-10 Thread H. S. Teoh via Digitalmars-d-learn
On Wed, Feb 10, 2021 at 11:35:27PM +, WhatMeWorry via Digitalmars-d-learn wrote: [...] > Okay, thanks. Then why does the README.md at > > https://github.com/dlang/druntime > > say "Runtime is typically linked together with Phobos in a release > such that the compiler only has to link to a si

Re: Real simple unresolved external symbols question...

2021-02-10 Thread kinke via Digitalmars-d-learn
On Tuesday, 9 February 2021 at 19:37:17 UTC, WhatMeWorry wrote: I'm trying to create a super simple dynamic library consisting of two files: file2.d -- extern(D): double addEight(double d) { return (d + 8.0); } fileB.d -

Re: Profiling

2021-02-10 Thread mw via Digitalmars-d-learn
On Wednesday, 10 February 2021 at 11:52:51 UTC, JG wrote: As a follow up question I would like to know what tool people use to profile d programs? I use this one: https://code.dlang.org/packages/profdump e.g. ``` dub build --build=debug --build=profile # run your program to generate trace

Re: Real simple unresolved external symbols question...

2021-02-10 Thread WhatMeWorry via Digitalmars-d-learn
On Wednesday, 10 February 2021 at 11:38:00 UTC, Ferhat Kurtulmuş wrote: On Tuesday, 9 February 2021 at 19:37:17 UTC, WhatMeWorry wrote: I'm trying to create a super simple dynamic library consisting of two files: [...] remove /NOENTRY, and include "mixin SimpleDllMain;" in one of the sour

Re: Profiling

2021-02-10 Thread Max Haughton via Digitalmars-d-learn
On Wednesday, 10 February 2021 at 13:31:09 UTC, Guillaume Piolat wrote: On Wednesday, 10 February 2021 at 11:52:51 UTC, JG wrote: [...] Here is what I use for sampling profiler: (On Windows) Build with LDC, x86_64, with dub -b release-debug in order to have debug info. Run your program int

Re: GC.addRange in pure function

2021-02-10 Thread Petar via Digitalmars-d-learn
On Wednesday, 10 February 2021 at 16:25:44 UTC, Petar Kirov [ZombineDev] wrote: [..] A few practical examples: Here it is deemed that the only observable side-effect of `malloc` and friends is the setting of `errno` in case of failure, so these wrappers ensure that this is not observed. Sur

Re: GC.addRange in pure function

2021-02-10 Thread Petar via Digitalmars-d-learn
On Wednesday, 10 February 2021 at 13:44:53 UTC, vit wrote: On Wednesday, 10 February 2021 at 12:17:43 UTC, rm wrote: On 09/02/2021 5:05, frame wrote: On Sunday, 7 February 2021 at 14:13:18 UTC, vitamin wrote: Why using 'new' is allowed in pure functions but calling GC.addRange or GC.removeRang

Re: GC.addRange in pure function

2021-02-10 Thread vit via Digitalmars-d-learn
On Wednesday, 10 February 2021 at 12:17:43 UTC, rm wrote: On 09/02/2021 5:05, frame wrote: On Sunday, 7 February 2021 at 14:13:18 UTC, vitamin wrote: Why using 'new' is allowed in pure functions but calling GC.addRange or GC.removeRange isn't allowed? Does 'new' violate the 'pure' paradigm? P

Re: Profiling

2021-02-10 Thread Guillaume Piolat via Digitalmars-d-learn
On Wednesday, 10 February 2021 at 11:52:51 UTC, JG wrote: Thanks for the suggestions. However, I would prefer not to spend time trying to debug d-profile-viewer at the moment. As a follow up question I would like to know what tool people use to profile d programs? Here is what I use for sa

Re: Profiling

2021-02-10 Thread drug via Digitalmars-d-learn
On 2/10/21 2:52 PM, JG wrote: On Tuesday, 9 February 2021 at 18:33:16 UTC, drug wrote: On Tuesday, 9 February 2021 at 07:45:13 UTC, JG wrote: I was trying to profile a d program. So I ran: dub build --build=profile. I then ran the program and it produced trace.log and trace.def. I then ran d-p

Re: GC.addRange in pure function

2021-02-10 Thread rm via Digitalmars-d-learn
On 09/02/2021 5:05, frame wrote: On Sunday, 7 February 2021 at 14:13:18 UTC, vitamin wrote: Why using 'new' is allowed in pure functions but calling GC.addRange or GC.removeRange isn't allowed? Does 'new' violate the 'pure' paradigm? Pure functions can only call pure functions and GC.addRange

Re: Profiling

2021-02-10 Thread JG via Digitalmars-d-learn
On Tuesday, 9 February 2021 at 18:33:16 UTC, drug wrote: On Tuesday, 9 February 2021 at 07:45:13 UTC, JG wrote: I was trying to profile a d program. So I ran: dub build --build=profile. I then ran the program and it produced trace.log and trace.def. I then ran d-profile-viewer and got the foll

Re: Real simple unresolved external symbols question...

2021-02-10 Thread Ferhat Kurtulmuş via Digitalmars-d-learn
On Tuesday, 9 February 2021 at 19:37:17 UTC, WhatMeWorry wrote: I'm trying to create a super simple dynamic library consisting of two files: [...] remove /NOENTRY, and include "mixin SimpleDllMain;" in one of the sources. And link with druntime. link /DLL file2.obj fileB.obj druntime-ldc

Re: Real simple unresolved external symbols question...

2021-02-10 Thread Rumbu via Digitalmars-d-learn
On Tuesday, 9 February 2021 at 19:37:17 UTC, WhatMeWorry wrote: I'm trying to create a super simple dynamic library consisting of two files: file2.d -- extern(D): double addEight(double d) { return (d + 8.0); } fileB.d -

Re: Real simple unresolved external symbols question...

2021-02-10 Thread Kagamin via Digitalmars-d-learn
Add libraries that provide missing symbols.

Re: GC.addRange in pure function

2021-02-10 Thread Dominikus Dittes Scherkl via Digitalmars-d-learn
On Tuesday, 9 February 2021 at 21:00:39 UTC, Paul Backus wrote: On Tuesday, 9 February 2021 at 19:53:27 UTC, Temtaime wrote: pure is broken. Just don't [use it] Allowing memory allocation in pure code in a language that can distinguish between pointer equality and value equality is, let's sa