Re: delete and references?

2009-08-08 Thread Andrei Alexandrescu
Jeremie Pelletier wrote: Jarrett Billingsley Wrote: On Fri, Aug 7, 2009 at 1:20 PM, Aaron Wattersarw1...@yahoo.com wrote: Hi guys. D looks cool. A couple of things confuse me. The first is: what happens if I do a delete cl; after storing a reference to cl somewhere? Can I use the stored

Re: delete and references?

2009-08-08 Thread Jarrett Billingsley
On Sat, Aug 8, 2009 at 9:17 AM, Andrei Alexandrescuseewebsiteforem...@erdani.org wrote: FWIW, I am trying to convince Walter to not reclaim memory in delete, but instead only call destructors. D continues C++'s mistake of conflating lifetime termination with memory reclamation. Why? Instead

Re: delete and references?

2009-08-08 Thread Andrei Alexandrescu
Jarrett Billingsley wrote: On Sat, Aug 8, 2009 at 9:17 AM, Andrei Alexandrescuseewebsiteforem...@erdani.org wrote: FWIW, I am trying to convince Walter to not reclaim memory in delete, but instead only call destructors. D continues C++'s mistake of conflating lifetime termination with memory

Re: delete and references?

2009-08-08 Thread Jarrett Billingsley
On Sat, Aug 8, 2009 at 9:42 AM, Andrei Alexandrescuseewebsiteforem...@erdani.org wrote: Jarrett Billingsley wrote: On Sat, Aug 8, 2009 at 9:17 AM, Andrei Alexandrescuseewebsiteforem...@erdani.org wrote: FWIW, I am trying to convince Walter to not reclaim memory in delete, but instead only

Re: delete and references?

2009-08-08 Thread Leandro Lucarella
Andrei Alexandrescu, el 8 de agosto a las 08:42 me escribiste: Jarrett Billingsley wrote: On Sat, Aug 8, 2009 at 9:17 AM, Andrei Alexandrescuseewebsiteforem...@erdani.org wrote: FWIW, I am trying to convince Walter to not reclaim memory in delete, but instead only call destructors. D

Re: delete and references?

2009-08-08 Thread Daniel Keep
Andrei Alexandrescu wrote: ... And what if you used it to try to delete a temporary array? Yes, you could use malloc/free for the temp array, but.. it just seems silly to have to dip into C functions to do that. Why? It's not a frequent need. I use it quite a bit, mostly because scope

Re: delete and references?

2009-08-08 Thread Leandro Lucarella
Leandro Lucarella, el 8 de agosto a las 11:22 me escribiste: Andrei Alexandrescu, el 8 de agosto a las 08:42 me escribiste: Jarrett Billingsley wrote: On Sat, Aug 8, 2009 at 9:17 AM, Andrei Alexandrescuseewebsiteforem...@erdani.org wrote: FWIW, I am trying to convince Walter to not

Re: delete and references?

2009-08-08 Thread Jeremie Pelletier
Jarrett Billingsley Wrote: On Sat, Aug 8, 2009 at 9:42 AM, Andrei Alexandrescuseewebsiteforem...@erdani.org wrote: Jarrett Billingsley wrote: On Sat, Aug 8, 2009 at 9:17 AM, Andrei Alexandrescuseewebsiteforem...@erdani.org wrote: FWIW, I am trying to convince Walter to not reclaim

Re: delete and references?

2009-08-08 Thread Michel Fortin
On 2009-08-08 09:17:28 -0400, Andrei Alexandrescu seewebsiteforem...@erdani.org said: Great description. FWIW, I am trying to convince Walter to not reclaim memory in delete, but instead only call destructors. D continues C++'s mistake of conflating lifetime termination with memory

Re: delete and references?

2009-08-08 Thread Andrei Alexandrescu
Jarrett Billingsley wrote: On Sat, Aug 8, 2009 at 9:42 AM, Andrei Alexandrescuseewebsiteforem...@erdani.org wrote: Jarrett Billingsley wrote: On Sat, Aug 8, 2009 at 9:17 AM, Andrei Alexandrescuseewebsiteforem...@erdani.org wrote: FWIW, I am trying to convince Walter to not reclaim memory in

Re: delete and references?

2009-08-08 Thread Andrei Alexandrescu
Michel Fortin wrote: On 2009-08-08 09:17:28 -0400, Andrei Alexandrescu seewebsiteforem...@erdani.org said: Great description. FWIW, I am trying to convince Walter to not reclaim memory in delete, but instead only call destructors. D continues C++'s mistake of conflating lifetime

Re: delete and references?

2009-08-08 Thread Jeremie Pelletier
Andrei Alexandrescu Wrote: Michel Fortin wrote: On 2009-08-08 09:17:28 -0400, Andrei Alexandrescu seewebsiteforem...@erdani.org said: Great description. FWIW, I am trying to convince Walter to not reclaim memory in delete, but instead only call destructors. D continues C++'s

Re: delete and references?

2009-08-08 Thread bearophile
Jeremie Pelletier: It's impossible to know if a pointer is unique without scanning the entire heap and pausing all threads to scan their stacks. Are you saying this after reading Bartoz blog posts? Bye, bearophile

Re: delete and references?

2009-08-08 Thread Jeremie Pelletier
bearophile Wrote: Jeremie Pelletier: It's impossible to know if a pointer is unique without scanning the entire heap and pausing all threads to scan their stacks. Are you saying this after reading Bartoz blog posts? Bye, bearophile No I haven't, do you have a link?

Re: delete and references?

2009-08-08 Thread bearophile
Jeremie Pelletier: No I haven't, do you have a link? With the power of Google this is the blog of Bartosz Milewski, you may read about the last ten posts or so: http://bartoszmilewski.wordpress.com/ Bye, bearophile

delete and references?

2009-08-07 Thread Aaron Watters
Hi guys. D looks cool. A couple of things confuse me. The first is: what happens if I do a delete cl; after storing a reference to cl somewhere? Can I use the stored reference? Is it invalid? Please elucidate, thanks. -- Aaron Watters ps: sorry if this is a repeat, but if it is it

Re: delete and references?

2009-08-07 Thread Jarrett Billingsley
On Fri, Aug 7, 2009 at 1:20 PM, Aaron Wattersarw1...@yahoo.com wrote: Hi guys.  D looks cool.  A couple of things confuse me. The first is: what happens if I do a delete cl; after storing a reference to cl somewhere?  Can I use the stored reference?  Is it invalid?  Please elucidate,

Re: delete and references?

2009-08-07 Thread Jeremie Pelletier
Jarrett Billingsley Wrote: On Fri, Aug 7, 2009 at 1:20 PM, Aaron Wattersarw1...@yahoo.com wrote: Hi guys.  D looks cool.  A couple of things confuse me. The first is: what happens if I do a delete cl; after storing a reference to cl somewhere?  Can I use the stored reference?  Is