allocate array with new
Jonathan M Davis
jmdavisProg at gmx.com
Tue May 15 11:19:56 PDT 2012
On Tuesday, May 15, 2012 15:27:51 Namespace wrote:
> And what if i use an array of structs? Also clear instead of
> delete?
delete is going to be _removed from the language_, so just don't use it. If
you're going to use anything, use clear. Using clear on the array will set it
to null and do whatever the GC does to finalize an array before collecting it.
You really shouldn't be worrying about freeing memory unless you clearly have
a performance issue where you need to manage memory more directly. The garbage
collector is supposed to worry about all that.
- Jonathan M Davis
More information about the Digitalmars-d-learn
mailing list