Re: struct destructor

2021-05-20 Thread Imperatorn via Digitalmars-d-learn

On Sunday, 16 May 2021 at 11:42:19 UTC, Adam D. Ruppe wrote:

On Sunday, 16 May 2021 at 08:04:06 UTC, cc wrote:

[...]


destroy + GC.free has a quirk - GC.free only works on what 
GC.malloc returns, a base pointer, NOT what `new` returns. The 
documentation says this but it is a subtle detail easy to 
miss...


...including by other stdlib authors. __delete is simply 
incorrectly implemented and an accidental no-op in most cases!


https://issues.dlang.org/show_bug.cgi?id=21550

The documentation that describes how to migrate away from 
`delete` made this same error.


I tracked down the problem but wasn't 100% sure about the fix. 
Adding the GC.baseOf thing works for me but i didn't upstream 
since idk if it works for everyone else.


maybe i should just do it though.


I'd say do it and then >9000 devs will comment, possibly leading 
to the truth. No comments = it's already acceptable.


Re: Test thread

2021-05-20 Thread Imperatorn via Digitalmars-d-learn
On Thursday, 20 May 2021 at 23:07:48 UTC, Daniel Donnelly, Jr 
wrote:
D could be the greatest thing on the planet.  Like Python, D 
will take over the world of coding.


Glad you like it 😎


Re: Compiler version "dirty"

2021-05-20 Thread JN via Digitalmars-d-learn

On Tuesday, 9 March 2021 at 01:36:18 UTC, Paul Backus wrote:

On Monday, 8 March 2021 at 22:29:58 UTC, Q. Schroll wrote:

When I enter `dmd --version`, it says:
  DMD64 D Compiler v2.095.1-dirty
What should the "dirty" mean? To me, it seems looks something 
went wrong somewhere.


It means someone made a mistake when preparing the release. 
Probably harmless.


v2.096.1 also reports as -dirty


Re: Test thread

2021-05-20 Thread Daniel via Digitalmars-d-learn
D could be the greatest thing on the planet.  Like Python, D will 
take over the world of coding.


Re: Test thread

2021-05-20 Thread Daniel via Digitalmars-d-learn
On Thursday, 20 May 2021 at 22:54:18 UTC, Daniel Donnelly, Jr 
wrote:

Hi, I'm just testing whether I can post here.  Thank you.


Okay it worked.  I am installing Visual D now.  I am going to 
write a program that tries to guess a mathematical model of data 
using < 10 operators.  I won't include elementary functions, but 
will include % function composition and indexing into the 
previous data.


I'm just telling you that because I can't delete this test post, 
and I don't want my account banned for spam.


Test thread

2021-05-20 Thread Daniel via Digitalmars-d-learn

Hi, I'm just testing whether I can post here.  Thank you.


Re: struct destructor

2021-05-20 Thread frame via Digitalmars-d-learn

On Sunday, 16 May 2021 at 11:42:19 UTC, Adam D. Ruppe wrote:

On Sunday, 16 May 2021 at 08:04:06 UTC, cc wrote:


I tracked down the problem but wasn't 100% sure about the fix. 
Adding the GC.baseOf thing works for me but i didn't upstream 
since idk if it works for everyone else.


maybe i should just do it though.


I don't know it it is really affected but

there is also a GC.free with just .ptr in AAs implementation in 
resize(). As I am understanding this issue it would lead to 
memory leaks on buckets (on re-used AA or if it cannot be set to 
null) with many items that are shrinking or growing over time.


And any pointer in the buckets entry would be seen alive too?

I know that are edge cases but still... maybe you could have a 
look at these things in the runtime source too.