On Monday, 15 October 2018 at 04:14:24 UTC, IM wrote:
What is the effect of calling destroy?
- calling the destructor?
- deallocating the memory?
- both?
It calls the destructor. The GC will deallocate the object's
memory later. However, you need to be careful about how you use
On Monday, 15 October 2018 at 04:14:24 UTC, IM wrote:
What is the effect of calling destroy?
- calling the destructor?
- deallocating the memory?
- both?
IIRC, it only calls the destructor, the GC will decide when to
deallocate the memory.
On Monday, 15 October 2018 at 03:33:04 UTC, Basile B. wrote:
On Monday, 15 October 2018 at 03:19:07 UTC, IM wrote:
I probably used to know the answer to this question, but it's
been a long time since I last used D, and I don't remember.
Suppose we have:
struct S {
int num;
}
Would
On Monday, 15 October 2018 at 03:19:07 UTC, IM wrote:
I probably used to know the answer to this question, but it's
been a long time since I last used D, and I don't remember.
Suppose we have:
struct S {
int num;
}
Would allocating an instance on the heap using:
S* s = new S;
use the GC,
I probably used to know the answer to this question, but it's
been a long time since I last used D, and I don't remember.
Suppose we have:
struct S {
int num;
}
Would allocating an instance on the heap using:
S* s = new S;
use the GC, or do we have to call destroy() or delete on s