On 7/2/20 10:51 AM, kinke wrote:
On Thursday, 2 July 2020 at 16:51:52 UTC, kinke wrote:
`= void` for members doesn't work and, I dare say, not work anytime
soon if ever.
I've quickly checked; `= void` for members has initialize-with-zeros
semantics too, so with LDC, it's equivalent to `= 0`
On Thursday, 2 July 2020 at 16:51:52 UTC, kinke wrote:
`= void` for members doesn't work and, I dare say, not work
anytime soon if ever.
I've quickly checked; `= void` for members has
initialize-with-zeros semantics too, so with LDC, it's equivalent
to `= 0` but applicable to user-defined
On Thursday, 2 July 2020 at 15:20:23 UTC, Ali Çehreli wrote:
According to its date, it was written when I was working for
Weka. Apparently, ldc took care of it for them after all.
If so, then without them posting any issue beforehand or giving
any feedback afterwards.
> For recent LDC
I have this runtime written in C++ that allows callbacks for
various functionality. In C++ the callbacks are stored as a
function pointer together with a void* that is passed as first
argument. The void* can be a lot of things, for example the class
pointer in C++. However, this is a bit
On 7/2/20 3:37 AM, kinke wrote:
> On Thursday, 2 July 2020 at 07:51:29 UTC, Ali Çehreli wrote:
>> Of course, the solution is to define members with '= void'
>
> Since when? https://issues.dlang.org/show_bug.cgi?id=11331 and your
> https://issues.dlang.org/show_bug.cgi?id=16956 are still open.
On 7/2/20 2:37 AM, IGotD- wrote:
> what on earth are those extra 800MB?
I'm losing my mind. :) Of course it's just 8M. Too many digits for me to
handle. :p
> Also, this an obvious optimization that can be implemented, that the
> program do an initialization loop instead of putting it in the
On Thursday, 2 July 2020 at 10:37:27 UTC, kinke wrote:
I don't think a struct should ever be that large, as it can
probably only live on the heap anyway and only passed around by
refs. I'd probably use a thin struct instead, containing and
managing a `double[]` member (or
On Thursday, 2 July 2020 at 07:51:29 UTC, Ali Çehreli wrote:
Of course, the solution is to define members with '= void'
Since when? https://issues.dlang.org/show_bug.cgi?id=11331 and
your https://issues.dlang.org/show_bug.cgi?id=16956 are still
open.
For recent LDC versions, the 'solution'
On Thursday, 2 July 2020 at 07:51:29 UTC, Ali Çehreli wrote:
Normally, struct .init values are known at compile time.
Unfortunately, they add to binary size:
[...]
memset() is the function you want. The initializer is an element
generated in the data segment (or in a read only segment) that
On Thursday, 2 July 2020 at 07:51:29 UTC, Ali Çehreli wrote:
Both asserts pass: S.init is 800M and is embedded into the
compiled program.
Not an answer to your problem but what on earth are those extra
800MB? The array size is 8MB so if the program would just copy
the data it would just
Normally, struct .init values are known at compile time. Unfortunately,
they add to binary size:
enum elementCount = 1024 * 1024;
struct S {
double[elementCount] a;
}
void main() {
S s;
assert(typeid(S).initializer.length == double.sizeof * elementCount);
11 matches
Mail list logo