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-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 > > > >

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 syste

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 Steven Schveighoffer
On Tue, 19 Apr 2011 14:04:38 -0400, 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. I'm neutral on the subject, you'd

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-18 Thread Steven Schveighoffer
On Mon, 18 Apr 2011 15:17:11 -0400, KennyTM~ 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 Fawcett wrote: [snip] The recommended alternative to destruction is to use clear, since

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 Fawcett wrote: [snip] The recommended alternative to destruction is to use clear, since it runs the appropriate finalizers, plus sets it to nu

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 > wrote: > >> On Mon, 18 Apr 2011 10:03:10 -0400, Steven Schveighoffer wrote: >> >>> On Mon, 18 Apr 2011 09:44:38 -0400, lenochware >>> wrote: >>> == Quote from Steven Schve

Re: lame question

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

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 > wrote: > >> == Quote from Steven Schveighoffer (schvei...@yahoo.com)'s article >>> On Mon, 18 Apr 2011 04:31:26 -0400, %u wrote: >>> > Is it necessary free memory allocated for mem

Re: lame question

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

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 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 04:31:26 -0400, %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.pixel

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 necessa

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 mal

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]; > (...) > // dele

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;