3 ms·
core.memory.GC.free(void* p) should do that for you.
by WalterBright 12y ago
core.memory.GC.free(void* p) should do that for you.
- tormeh 12y agoThat's great! Unfortunately I program in Scala, so D-specific advice doesn't really help me. Edited top post.
- bjourne 12y agoWhat happens if another object holds a reference to p? Bad things?
- tormeh 12y agoYeah. Some sort of nullpointerexceptions, I would imagine.
- WalterBright 12y agoYes, bad things, i.e. memory corruption. Manual memory management means it's up to the programmer to get it right.