Re: assert(false) and GC

2021-07-11 Thread Steven Schveighoffer via Digitalmars-d-learn
On 7/10/21 12:32 PM, Mathias LANG wrote: On Saturday, 10 July 2021 at 01:38:06 UTC, russhy wrote: On Saturday, 10 July 2021 at 01:23:26 UTC, Steven Schveighoffer wrote: I think it's the throwing/catching of the `Throwable` that is allocating. But I don't know from where the allocation

Re: assert(false) and GC

2021-07-10 Thread russhy via Digitalmars-d-learn
On Saturday, 10 July 2021 at 16:32:30 UTC, Mathias LANG wrote: On Saturday, 10 July 2021 at 01:38:06 UTC, russhy wrote: On Saturday, 10 July 2021 at 01:23:26 UTC, Steven Schveighoffer wrote: I think it's the throwing/catching of the `Throwable` that is allocating. But I don't know from where

Re: assert(false) and GC

2021-07-10 Thread Mathias LANG via Digitalmars-d-learn
On Saturday, 10 July 2021 at 01:38:06 UTC, russhy wrote: On Saturday, 10 July 2021 at 01:23:26 UTC, Steven Schveighoffer wrote: I think it's the throwing/catching of the `Throwable` that is allocating. But I don't know from where the allocation happens. -Steve i think you are right Try

Re: assert(false) and GC

2021-07-09 Thread russhy via Digitalmars-d-learn
On Saturday, 10 July 2021 at 01:23:26 UTC, Steven Schveighoffer wrote: On 7/9/21 8:44 PM, russhy wrote: On Friday, 9 July 2021 at 23:34:25 UTC, Ali Çehreli wrote: On 7/9/21 4:12 PM, russhy wrote: >> One way of forcing compile-time evaluation in D is to >> define an enum >> (which means

Re: assert(false) and GC

2021-07-09 Thread Steven Schveighoffer via Digitalmars-d-learn
On 7/9/21 8:44 PM, russhy wrote: On Friday, 9 July 2021 at 23:34:25 UTC, Ali Çehreli wrote: On 7/9/21 4:12 PM, russhy wrote: >> One way of forcing compile-time evaluation in D is to define an enum >> (which means "manifest constant" in that use). That's all I meant. It was a general comment.

Re: assert(false) and GC

2021-07-09 Thread russhy via Digitalmars-d-learn
On Friday, 9 July 2021 at 23:34:25 UTC, Ali Çehreli wrote: On 7/9/21 4:12 PM, russhy wrote: >> One way of forcing compile-time evaluation in D is to define an enum >> (which means "manifest constant" in that use). That's all I meant. It was a general comment. > this is very bad, assert are

Re: assert(false) and GC

2021-07-09 Thread Ali Çehreli via Digitalmars-d-learn
On 7/9/21 4:12 PM, russhy wrote: >> One way of forcing compile-time evaluation in D is to define an enum >> (which means "manifest constant" in that use). That's all I meant. It was a general comment. > this is very bad, assert are good because they are one liner, making it > 2 line to avoid

Re: assert(false) and GC

2021-07-09 Thread russhy via Digitalmars-d-learn
On Friday, 9 July 2021 at 22:53:10 UTC, Ali Çehreli wrote: On 7/8/21 11:11 AM, DLearner wrote: Hi Please confirm that: `    assert(false, __FUNCTION__ ~ "This is an error message"); ` Will _not_ trigger GC issues, as the text is entirely known at compile time. Best regards One way of

Re: assert(false) and GC

2021-07-09 Thread Ali Çehreli via Digitalmars-d-learn
On 7/8/21 11:11 AM, DLearner wrote: Hi Please confirm that: `    assert(false, __FUNCTION__ ~ "This is an error message"); ` Will _not_ trigger GC issues, as the text is entirely known at compile time. Best regards One way of forcing compile-time evaluation in D is to define an enum

Re: assert(false) and GC

2021-07-09 Thread russhy via Digitalmars-d-learn
i think it only allocate when it hit the assert, but program will halt so it's not big deal, even though i feel this is a stupid design to make everything depend on GC... it gives bad impression when you want avoid it here is how i do to detect hidden GC allocations

Re: assert(false) and GC

2021-07-08 Thread jmh530 via Digitalmars-d-learn
On Thursday, 8 July 2021 at 18:11:50 UTC, DLearner wrote: Hi Please confirm that: ` assert(false, __FUNCTION__ ~ "This is an error message"); ` Will _not_ trigger GC issues, as the text is entirely known at compile time. Best regards Consider below. Only z will generate an error. This

assert(false) and GC

2021-07-08 Thread DLearner via Digitalmars-d-learn
Hi Please confirm that: ` assert(false, __FUNCTION__ ~ "This is an error message"); ` Will _not_ trigger GC issues, as the text is entirely known at compile time. Best regards