On Thursday, 19 August 2021 at 15:38:19 UTC, evilrat wrote:
On Thursday, 19 August 2021 at 15:12:03 UTC, Ferhat Kurtulmuş
Btw, based on
https://github.com/dlang/druntime/blob/master/src/object.d#L4209:
import core.lifetime;
import core.stdc.stdio;
import core.stdc.stdlib;
extern (C) void rt
On Thursday, 19 August 2021 at 15:38:19 UTC, evilrat wrote:
On Thursday, 19 August 2021 at 15:12:03 UTC, Ferhat Kurtulmuş
This is cool, but even in unit tests for malloc wrapper there
is only simple case with class without references to another
class and no dtor.
If you examine the entire l
On Thursday, 19 August 2021 at 09:39:26 UTC, evilrat wrote:
On Thursday, 19 August 2021 at 08:25:23 UTC, Bienlein wrote:
Oops, I just realized that you can also not call emplace when
@nogc is present. Well that is at least consistent with not
either being able to call destroy ;-).
So, I gue
On Thursday, 19 August 2021 at 15:12:03 UTC, Ferhat Kurtulmuş
wrote:
On Thursday, 19 August 2021 at 07:30:38 UTC, Bienlein wrote:
Hello,
I allocate some instance of class C manually and then free the
memory again:
[...]
I just wanted to leave this here.
https://github.com/AuburnSounds/Dplu
On Thursday, 19 August 2021 at 07:30:38 UTC, Bienlein wrote:
Hello,
I allocate some instance of class C manually and then free the
memory again:
[...]
I just wanted to leave this here.
https://github.com/AuburnSounds/Dplug/blob/master/core/dplug/core/nogc.d
This works, vit. Thanks! I thought it wouldn't, because your code
still makes use of embrace. But it somehow worked, although I
don't understand why ... ;-).
I also added a constructor using the same approach as your
destructor and this also worked:
this(int otherNum) @nogc {
t
On Thursday, 19 August 2021 at 08:25:23 UTC, Bienlein wrote:
Oops, I just realized that you can also not call emplace when
@nogc is present. Well that is at least consistent with not
either being able to call destroy ;-).
So, I guess this means that you can forget about manually
allocating
On Thursday, 19 August 2021 at 08:25:23 UTC, Bienlein wrote:
On Thursday, 19 August 2021 at 07:30:38 UTC, Bienlein wrote:
Hello,
I allocate some instance of class C manually and then free the
memory again:
class C {
int num;
~this() {
writeln("~this");
}
On Thursday, 19 August 2021 at 07:30:38 UTC, Bienlein wrote:
Hello,
I allocate some instance of class C manually and then free the
memory again:
class C {
int num;
~this() {
writeln("~this");
}
}
void foo() // @nogc
{
auto mem = cast(C
Hello,
I allocate some instance of class C manually and then free the
memory again:
class C {
int num;
~this() {
writeln("~this");
}
}
void foo() // @nogc
{
auto mem = cast(C)malloc(__traits(classInstanceSize, C));
auto c = empl
10 matches
Mail list logo