Re: Unittests pass, and then an invalid memory operation happens after?

2024-04-06 Thread Lance Bachmeier via Digitalmars-d-learn
On Wednesday, 3 April 2024 at 21:57:00 UTC, Liam McGillivray wrote: Alright. I suppose that some of the optimization decisions I have made so far may have resulted in less readable code for little performance benefit. Now I'm trying to worry less about optimization. Everything has been very

Re: Unittests pass, and then an invalid memory operation happens after?

2024-04-06 Thread H. S. Teoh via Digitalmars-d-learn
On Wed, Apr 03, 2024 at 09:57:00PM +, Liam McGillivray via Digitalmars-d-learn wrote: > On Friday, 29 March 2024 at 01:18:22 UTC, H. S. Teoh wrote: > > Take a look at the docs for core.memory.GC. There *is* a method > > GC.free that you can use to manually deallocate GC-allocated memory > >

Re: Using core/sys/posix/mqueue.d on FreeBSD

2024-04-06 Thread Arjan via Digitalmars-d-learn
On Saturday, 6 April 2024 at 12:05:56 UTC, Jonathan M Davis wrote: Actually, since I'm usually the one who does the FreeBSD ones anyway, here you go: https://github.com/dlang/dmd/pull/16359 The declarations compile, and they should match the ones in C, since I copied them over and then

Re: Using core/sys/posix/mqueue.d on FreeBSD

2024-04-06 Thread Jonathan M Davis via Digitalmars-d-learn
Actually, since I'm usually the one who does the FreeBSD ones anyway, here you go: https://github.com/dlang/dmd/pull/16359 The declarations compile, and they should match the ones in C, since I copied them over and then tweaked them, but I haven't actually tested them. All that being said, even

Re: Using core/sys/posix/mqueue.d on FreeBSD

2024-04-06 Thread Jonathan M Davis via Digitalmars-d-learn
On Saturday, April 6, 2024 3:57:46 AM MDT Arjan via Digitalmars-d-learn wrote: > I'm using posix mqueue in a D application on Linux. Works fine. > But on FreeBSD it fails to compile due to the version statement: > > [version (CRuntime_Glibc):]( >

Re: Inconsistent chain (implicitly converts to int)

2024-04-06 Thread Salih Dincer via Digitalmars-d-learn
On Saturday, 6 April 2024 at 09:21:34 UTC, rkompass wrote: I checked: ```d import std.stdio, std.range, std.algorithm; struct N(T) { T last, step, first; bool empty() => first >= last; T front() => first; auto popFront() => first += step; } void main() { auto r1 =

Re: Inconsistent chain (implicitly converts to int)

2024-04-06 Thread rkompass via Digitalmars-d-learn
On Friday, 5 April 2024 at 21:26:10 UTC, Salih Dincer wrote: On Friday, 5 April 2024 at 21:16:42 UTC, rkompass wrote: In the first example the int's are converted to doubles (also common type). But they appear as int's because writeln does not write a trailing .0. But it doesn't work as

Re: impure

2024-04-06 Thread Jonathan M Davis via Digitalmars-d-learn
On Friday, April 5, 2024 3:11:42 AM MDT Dom DiSc via Digitalmars-d-learn wrote: > On Sunday, 24 March 2024 at 09:16:20 UTC, Jonathan M Davis wrote: > > So, yes, you've run into a problem that it would be nice to > > have a better fix for, but even if we could negate attributes > > in general,