Re: lame question

2011-04-20 Thread lenochware
== Quote from Andrei Alexandrescu (seewebsiteforem...@erdani.org)'s article On 4/19/11 1:04 PM, Timon Gehr wrote: Steven Schveighoffer wrote: And one other note -- delete will eventually be deprecated. In order to free memory, you must use clear and GC.free. -Steve Well, why? It

Re: lame question

2011-04-20 Thread Jesse Phillips
lenochware Wrote: Well, I don't understand internal architecture at all, but from user's point of view it would be good keep some simple and nice way to remove object. I like if I can have things under control - if I want. clear(myObjectThatMustGo);

Re: lame question

2011-04-19 Thread Timon Gehr
Steven Schveighoffer wrote: And one other note -- delete will eventually be deprecated. In order to free memory, you must use clear and GC.free. -Steve Well, why? It seems like a bad decision to me.

Re: lame question

2011-04-19 Thread Steven Schveighoffer
On Tue, 19 Apr 2011 14:04:38 -0400, Timon Gehr timon.g...@gmx.ch wrote: Steven Schveighoffer wrote: And one other note -- delete will eventually be deprecated. In order to free memory, you must use clear and GC.free. -Steve Well, why? It seems like a bad decision to me. I'm neutral on

Re: lame question

2011-04-19 Thread Andrei Alexandrescu
On 4/19/11 1:04 PM, Timon Gehr wrote: Steven Schveighoffer wrote: And one other note -- delete will eventually be deprecated. In order to free memory, you must use clear and GC.free. -Steve Well, why? It seems like a bad decision to me. The feature is not going away, just the keyword.

Re: lame question

2011-04-19 Thread bearophile
Andrei: (Some GCs are unable to implement delete meaningfully.) Manual memory disposal for the GC heap will be implemented as a template function with semantics defined by the GC implementation. Now the function(s) that replace delete are meant to be hints for the GC. In a system

lame question

2011-04-18 Thread %u
Is it necessary free memory allocated for member of structure, like in C? I suppose not (we have gc). Example: struct BITMAP { (...) ubyte[] pixels; } BITMAP* bitmap = new BITMAP; bitmap.pixels = new ubyte[100*100]; (...) // delete bitmap.pixels; //not necessary? delete bitmap;

Re: lame question

2011-04-18 Thread Francisco Almeida
== Quote from %u (lenochw...@gmail.com)'s article Is it necessary free memory allocated for member of structure, like in C? I suppose not (we have gc). Example: struct BITMAP { (...) ubyte[] pixels; } BITMAP* bitmap = new BITMAP; bitmap.pixels = new ubyte[100*100]; (...) // delete

Re: lame question

2011-04-18 Thread lenochware
I see...thanks for answer. And if I call delete bitmap, it will be removed immediatelly, or it doesn't matter and gc will remove it when it will start its cycle? So even ubyte[] pixels will be allocated on the stack ?? What is prefered method to allocate large byte array, then? Should I use

Re: lame question

2011-04-18 Thread spir
On 04/18/2011 10:31 AM, %u wrote: Is it necessary free memory allocated for member of structure, like in C? I suppose not (we have gc). Example: struct BITMAP { (...) ubyte[] pixels; } BITMAP* bitmap = new BITMAP; bitmap.pixels = new ubyte[100*100]; (...) // delete bitmap.pixels; //not

Re: lame question

2011-04-18 Thread Steven Schveighoffer
On Mon, 18 Apr 2011 04:31:26 -0400, %u lenochw...@gmail.com wrote: Is it necessary free memory allocated for member of structure, like in C? I suppose not (we have gc). Example: struct BITMAP { (...) ubyte[] pixels; } BITMAP* bitmap = new BITMAP; bitmap.pixels = new ubyte[100*100]; (...)

Re: lame question

2011-04-18 Thread lenochware
== Quote from Steven Schveighoffer (schvei...@yahoo.com)'s article On Mon, 18 Apr 2011 04:31:26 -0400, %u lenochw...@gmail.com wrote: Is it necessary free memory allocated for member of structure, like in C? I suppose not (we have gc). Example: struct BITMAP { (...) ubyte[] pixels;

Re: lame question

2011-04-18 Thread Steven Schveighoffer
On Mon, 18 Apr 2011 09:44:38 -0400, lenochware lenochw...@gmail.com wrote: == Quote from Steven Schveighoffer (schvei...@yahoo.com)'s article On Mon, 18 Apr 2011 04:31:26 -0400, %u lenochw...@gmail.com wrote: Is it necessary free memory allocated for member of structure, like in C? I

Re: lame question

2011-04-18 Thread Graham Fawcett
On Mon, 18 Apr 2011 10:03:10 -0400, Steven Schveighoffer wrote: On Mon, 18 Apr 2011 09:44:38 -0400, lenochware lenochw...@gmail.com wrote: == Quote from Steven Schveighoffer (schvei...@yahoo.com)'s article On Mon, 18 Apr 2011 04:31:26 -0400, %u lenochw...@gmail.com wrote: Is it necessary

Re: lame question

2011-04-18 Thread Steven Schveighoffer
On Mon, 18 Apr 2011 11:21:46 -0400, Graham Fawcett fawc...@uwindsor.ca wrote: On Mon, 18 Apr 2011 10:03:10 -0400, Steven Schveighoffer wrote: On Mon, 18 Apr 2011 09:44:38 -0400, lenochware lenochw...@gmail.com wrote: == Quote from Steven Schveighoffer (schvei...@yahoo.com)'s article On

Re: lame question

2011-04-18 Thread Graham Fawcett
On Mon, 18 Apr 2011 11:38:56 -0400, Steven Schveighoffer wrote: On Mon, 18 Apr 2011 11:21:46 -0400, Graham Fawcett fawc...@uwindsor.ca wrote: On Mon, 18 Apr 2011 10:03:10 -0400, Steven Schveighoffer wrote: On Mon, 18 Apr 2011 09:44:38 -0400, lenochware lenochw...@gmail.com wrote: ==

Re: lame question

2011-04-18 Thread KennyTM~
On Apr 19, 11 01:25, Graham Fawcett wrote: On Mon, 18 Apr 2011 11:38:56 -0400, Steven Schveighoffer wrote: On Mon, 18 Apr 2011 11:21:46 -0400, Graham Fawcettfawc...@uwindsor.ca wrote: [snip] The recommended alternative to destruction is to use clear, since it runs the appropriate

Re: lame question

2011-04-18 Thread Steven Schveighoffer
On Mon, 18 Apr 2011 15:17:11 -0400, KennyTM~ kenn...@gmail.com wrote: On Apr 19, 11 01:25, Graham Fawcett wrote: On Mon, 18 Apr 2011 11:38:56 -0400, Steven Schveighoffer wrote: On Mon, 18 Apr 2011 11:21:46 -0400, Graham Fawcettfawc...@uwindsor.ca wrote: [snip] The recommended alternative