Re: 0 cost template instantiation

2021-09-29 Thread Hipreme via Digitalmars-d-learn
On Thursday, 30 September 2021 at 03:21:51 UTC, jfondren wrote: On Thursday, 30 September 2021 at 03:13:28 UTC, jfondren wrote: As provided, loadSymbol without the "static if": 965K libhipengine_api.a with `mixin(loadSymbol("name"))` instead of a template: 749K libhipengine_api.a The

Re: 0 cost template instantiation

2021-09-29 Thread jfondren via Digitalmars-d-learn
On Thursday, 30 September 2021 at 03:13:28 UTC, jfondren wrote: As provided, loadSymbol without the "static if": 965K libhipengine_api.a with `mixin(loadSymbol("name"))` instead of a template: 749K libhipengine_api.a The difference goes down to 66K vs. 60K with `dub -brelease

Re: 0 cost template instantiation

2021-09-29 Thread jfondren via Digitalmars-d-learn
On Thursday, 30 September 2021 at 02:31:50 UTC, Hipreme wrote: https://github.com/MrcSnm/HipremeEngine/tree/hotload/api You may try messing at the module api.graphics.g2d.renderer2d There is a function called initG2D Try changing it from loadSymbols to each one loadSymbol. You can just dub

Re: 0 cost template instantiation

2021-09-29 Thread Hipreme via Digitalmars-d-learn
On Thursday, 30 September 2021 at 02:22:35 UTC, jfondren wrote: On Thursday, 30 September 2021 at 01:44:57 UTC, jfondren wrote: On Thursday, 30 September 2021 at 01:09:47 UTC, Hipreme wrote: I have a template function that all it does is given a symbol, it loads a dll for its type + its name:

Re: 0 cost template instantiation

2021-09-29 Thread jfondren via Digitalmars-d-learn
On Thursday, 30 September 2021 at 01:44:57 UTC, jfondren wrote: On Thursday, 30 September 2021 at 01:09:47 UTC, Hipreme wrote: I have a template function that all it does is given a symbol, it loads a dll for its type + its name: ``` void loadSymbol(alias s, string symName = "")() {

Re: 0 cost template instantiation

2021-09-29 Thread Adam D Ruppe via Digitalmars-d-learn
On Thursday, 30 September 2021 at 02:09:50 UTC, Hipreme wrote: I could reduce by almost 100kb of code by instead of using the former option, I use: yes this is what id o you can list the Ts in an interface too. see my simpledisplay.d `interface GL` for example I do still don't think that

Re: 0 cost template instantiation

2021-09-29 Thread Adam D Ruppe via Digitalmars-d-learn
On Thursday, 30 September 2021 at 02:02:19 UTC, Hipreme wrote: Instead of writing myFunction = cast(typeof(myFunction))_loadSymbol(_dll, "myFunction"); I could write loadSymbol!myFunction; But if no other way is found of doing that, I will do the massive rewriting. --- void function()

Re: 0 cost template instantiation

2021-09-29 Thread Hipreme via Digitalmars-d-learn
On Thursday, 30 September 2021 at 01:09:47 UTC, Hipreme wrote: I have a template function that all it does is given a symbol, it loads a dll for its type + its name: ``` void loadSymbol(alias s, string symName = "")() { static if(symName == "") s =

Re: 0 cost template instantiation

2021-09-29 Thread Basile B. via Digitalmars-d-learn
On Thursday, 30 September 2021 at 02:02:19 UTC, Hipreme wrote: On Thursday, 30 September 2021 at 01:56:42 UTC, Basile B. wrote: On Thursday, 30 September 2021 at 01:09:47 UTC, Hipreme wrote: I have a template function that all it does is given a symbol, it loads a dll for its type + its name:

Re: 0 cost template instantiation

2021-09-29 Thread Hipreme via Digitalmars-d-learn
On Thursday, 30 September 2021 at 01:56:42 UTC, Basile B. wrote: On Thursday, 30 September 2021 at 01:09:47 UTC, Hipreme wrote: I have a template function that all it does is given a symbol, it loads a dll for its type + its name: ``` void loadSymbol(alias s, string symName = "")() {

Re: 0 cost template instantiation

2021-09-29 Thread Basile B. via Digitalmars-d-learn
On Thursday, 30 September 2021 at 01:09:47 UTC, Hipreme wrote: I have a template function that all it does is given a symbol, it loads a dll for its type + its name: ``` void loadSymbol(alias s, string symName = "")() { static if(symName == "") s =

Re: 0 cost template instantiation

2021-09-29 Thread jfondren via Digitalmars-d-learn
On Thursday, 30 September 2021 at 01:09:47 UTC, Hipreme wrote: I have a template function that all it does is given a symbol, it loads a dll for its type + its name: ``` void loadSymbol(alias s, string symName = "")() { static if(symName == "") s =

0 cost template instantiation

2021-09-29 Thread Hipreme via Digitalmars-d-learn
I have a template function that all it does is given a symbol, it loads a dll for its type + its name: ``` void loadSymbol(alias s, string symName = "")() { static if(symName == "") s = cast(typeof(s))_loadSymbol(_dll, (s.stringof~"\0").ptr); else

Re: Loading assimp

2021-09-29 Thread russhy via Digitalmars-d-learn
On Wednesday, 29 September 2021 at 02:47:09 UTC, Mike Parker wrote: On Tuesday, 28 September 2021 at 16:30:09 UTC, Eric_DD wrote: I am trying to use a newer version of Assimp. I have found a assimp-vc140-mt.dll (v3.3.1) which I renamed to assimp.dll When running my executable it throws a

Re: Why sometimes stacktraces are printed and sometimes not?

2021-09-29 Thread Steven Schveighoffer via Digitalmars-d-learn
On 9/29/21 6:57 AM, JN wrote: What makes the difference on whether a crash stacktrace gets printed or not? Sometimes I get a nice clean stacktrace with line numbers, sometimes all I get is "segmentation fault error -1265436346" (pseudo example) and I need to run under debugger to get the

Re: Why sometimes stacktraces are printed and sometimes not?

2021-09-29 Thread Steven Schveighoffer via Digitalmars-d-learn
On 9/29/21 8:15 AM, Steven Schveighoffer wrote: On Linux, there is the undocumented `etc.linux.memoryhandler` Sorry, it's `etc.linux.memoryerror` Here is the code: https://github.com/dlang/druntime/blob/master/src/etc/linux/memoryerror.d -Steve

Re: Loading assimp

2021-09-29 Thread russhy via Digitalmars-d-learn
On Tuesday, 28 September 2021 at 20:09:41 UTC, Eric_DD wrote: On Tuesday, 28 September 2021 at 19:59:09 UTC, russhy wrote: On Tuesday, 28 September 2021 at 16:30:09 UTC, Eric_DD wrote: I am trying to use a newer version of Assimp. I have found a assimp-vc140-mt.dll (v3.3.1) which I renamed to

Re: Loading assimp

2021-09-29 Thread Guillaume Piolat via Digitalmars-d-learn
On Tuesday, 28 September 2021 at 16:30:09 UTC, Eric_DD wrote: I am trying to use a newer version of Assimp. I have found a assimp-vc140-mt.dll (v3.3.1) which I renamed to assimp.dll When running my executable it throws a derelict.util.exception.SharedLibLoadException: "Failed to load one

Why sometimes stacktraces are printed and sometimes not?

2021-09-29 Thread JN via Digitalmars-d-learn
What makes the difference on whether a crash stacktrace gets printed or not? Sometimes I get a nice clean stacktrace with line numbers, sometimes all I get is "segmentation fault error -1265436346" (pseudo example) and I need to run under debugger to get the crash location.

Re: Using D "rocket" logo in outside presentation

2021-09-29 Thread WebFreak001 via Digitalmars-d-learn
On Wednesday, 29 September 2021 at 04:24:13 UTC, Chris Piker wrote: Hi D I'm to give a presentation to a combined NASA/ESA group in a few hours and would like to include a copy of the D "rocket" logo when mentioning new server side tools that I've written in D. Is such use of this