digitalmars.D - A feature request
- =?ISO-8859-1?Q?=c2=de=d3=c2=b8=d5?= (2/2) Jun 26 2008 I recommend that in D2 add a new keyword gcnew for garbage collection he...
- bearophile (4/6) Jun 27 2008 In D the "default" is generally the safer way (that here is the GC way),...
- Yonggang Luo (2/10) Jul 07 2008 Yes, gc is more safe, but also there is a keyword delete, is there any c...
- Robert Fraser (2/12) Jul 07 2008 No. It will work fine.
- bearophile (4/5) Jul 07 2008 In a reference counting GC the detele isn't a way to delete memory by ha...
- Stewart Gordon (18/24) Jul 15 2008 If you want C++, you know where to find it. If people are thinking in C...
I recommend that in D2 add a new keyword gcnew for garbage collection heap allocation. the default new and delete key word just for someone that want management the memory by themselves. I think we just using new for garbage collection memory allocation and for someone that using new for memory management by themeselvs will misleading!
Jun 26 2008
ÂÞÓÂ¸Õ Wrote:I recommend that in D2 add a new keyword gcnew for garbage collection heap allocation. the default new and delete key word just for someone that want management the memory by themselves. I think we just using new for garbage collection memory allocation and for someone that using new for memory management by themeselvs will misleading!In D the "default" is generally the safer way (that here is the GC way), this allows the programmer to put less bugs in the code. Bye, bearophile
Jun 27 2008
bearophile Wrote:ÂÞÓÂ¸Õ Wrote:Yes, gc is more safe, but also there is a keyword delete, is there any conflic here? I don't know if there conflict here. If I alloca memory space by gc, and delete it by hand, is there any conflict will happen?I recommend that in D2 add a new keyword gcnew for garbage collection heap allocation. the default new and delete key word just for someone that want management the memory by themselves. I think we just using new for garbage collection memory allocation and for someone that using new for memory management by themeselvs will misleading!In D the "default" is generally the safer way (that here is the GC way), this allows the programmer to put less bugs in the code. Bye, bearophile
Jul 07 2008
Yonggang Luo wrote:bearophile Wrote:No. It will work fine.ÂÞÓÂ¸Õ Wrote:Yes, gc is more safe, but also there is a keyword delete, is there any conflic here? I don't know if there conflict here. If I alloca memory space by gc, and delete it by hand, is there any conflict will happen?I recommend that in D2 add a new keyword gcnew for garbage collection heap allocation. the default new and delete key word just for someone that want management the memory by themselves. I think we just using new for garbage collection memory allocation and for someone that using new for memory management by themeselvs will misleading!In D the "default" is generally the safer way (that here is the GC way), this allows the programmer to put less bugs in the code. Bye, bearophile
Jul 07 2008
Yonggang Luo:Yes, gc is more safe, but also there is a keyword delete, is there any conflic here? I don't know if there conflict here. If I alloca memory space by gc, and delete it by hand, is there any conflict will happen?In a reference counting GC the detele isn't a way to delete memory by hand, it tells the GC to remove a (hard) refence to some memory. Later the GC can really remove the memory only if there aren't references to it left (this is in a reference counting GC, but in other GCs the final results are similar). Bye, bearophile
Jul 07 2008
"ÂÞÓ¸Õ" <yonggangluo hotmail.com> wrote in message news:g41tbc$3d4$1 digitalmars.com...I recommend that in D2 add a new keyword gcnew for garbage collection heap allocation. the default new and delete key word just for someone that want management the memory by themselves. I think we just using new for garbage collection memory allocation and for someone that using new for memory management by themeselvs will misleading!If you want C++, you know where to find it. If people are thinking in C++ while programming in D, they shouldn't. Changing D's new/delete to be for manual memory management would break nearly every D project ever conceived. Besides, such a change would make it appear that the 'normal' way of managing memory in D is manually, and GC is the alternative. Quite the opposite of the way D is designed. Besides, even if we did have this, would it: - be just syntactic sugar for malloc/free? - allocate on a third heap, besides the malloc heap and the GC heap? - allocate on the same heap as GC memory, but with a flag not to GC it? - something else? Stewart. -- My e-mail address is valid but not my primary mailbox. Please keep replies on the 'group where everybody may benefit.
Jul 15 2008