On Thu, 02 Sep 2010 09:31:22 -0400, Simen kjaeraas
<simen.kja...@gmail.com> wrote:
Peter Alexander <peter.alexander...@gmail.com> wrote:
Hi,
I've not been staying up to date on the new/delete discussions and
related memory management issues, so I have a few questions.
1. How do I disable the GC?
In a way, you don't. You can, however, replace it with a stub GC.
You can disable it (for most intents and purposes) at runtime:
http://www.dsource.org/projects/druntime/browser/trunk/src/core/memory.d#L77
2. Can I override new?
Yes. However, this is no longer mentioned on
http://digitalmars.com/d/2.0/class.html, so it might be intended not to
be there anymore.
class foo {
new( uint size ) {
return malloc( size );
}
}
This is going to be deprecated. Use emplace instead.
-Steve