digitalmars.D.learn - gc heap
- Sam S E (1/1) Nov 23 2008 What is allocated in the gc heap? Just classes? Dynamic/associative arra...
- Jarrett Billingsley (10/11) Nov 23 2008 Everything that is a reference type (classes, dynamic arrays, AAs) is
- Sam S E (3/18) Nov 23 2008 Thank you; thanks to you I now have a basic understanding of all the fea...
- Jarrett Billingsley (2/4) Nov 23 2008 What's that supposed to mean?
- Sam S E (2/9) Nov 23 2008 There are many useful and interesting features that are planned but unim...
- Jarrett Billingsley (2/11) Nov 23 2008 ...like what?
- Sam S E (22/37) Nov 23 2008 See http://s3.amazonaws.com/dconf2007/WalterAndrei.pdf.
- Jarrett Billingsley (8/27) Nov 23 2008 Ah, OK. Yeah, I wonder if a good number of those features will make
- Sam S E (2/35) Nov 23 2008 Better in what way? Do you like my syntax or do you have a better one?
- Jarrett Billingsley (3/4) Nov 23 2008 Oh, I was agreeing with you, as well as implying that struct literals
- Sam S E (3/8) Nov 24 2008 You're right, struct literals need to be updated, but I don't think it's...
What is allocated in the gc heap? Just classes? Dynamic/associative arrays? Structs? Only things allocated with new? Do built-in types and structs get deallocated at the end of scope like in C?
Nov 23 2008
On Sun, Nov 23, 2008 at 5:02 PM, Sam S E <asdf mailinator.com> wrote:What is allocated in the gc heap? Just classes? Dynamic/associative arrays? Structs? Only things allocated with new? Do built-in types and structs get deallocated at the end of scope like in C?Everything that is a reference type (classes, dynamic arrays, AAs) is allocated on the heap. Everything that is a value type (basic types, fixed-size arrays, structs) are allocated on the stack and are deallocated when the scope is left. scope references to classes will delete the class they refer to when the scope is left. As a special case, a declaration of the form "scope x = new ClassType()" will actually allocate the class instance on the stack instead of on the heap.
Nov 23 2008
Jarrett Billingsley Wrote:On Sun, Nov 23, 2008 at 5:02 PM, Sam S E <asdf mailinator.com> wrote:Thank you; thanks to you I now have a basic understanding of all the features of D. Now if only Walter could implement all of them :) --SamWhat is allocated in the gc heap? Just classes? Dynamic/associative arrays? Structs? Only things allocated with new? Do built-in types and structs get deallocated at the end of scope like in C?Everything that is a reference type (classes, dynamic arrays, AAs) is allocated on the heap. Everything that is a value type (basic types, fixed-size arrays, structs) are allocated on the stack and are deallocated when the scope is left. scope references to classes will delete the class they refer to when the scope is left. As a special case, a declaration of the form "scope x = new ClassType()" will actually allocate the class instance on the stack instead of on the heap.
Nov 23 2008
On Sun, Nov 23, 2008 at 5:35 PM, Sam S E <asdf mailinator.com> wrote:Thank you; thanks to you I now have a basic understanding of all the features of D. Now if only Walter could implement all of them :) --SamWhat's that supposed to mean?
Nov 23 2008
Jarrett Billingsley Wrote:On Sun, Nov 23, 2008 at 5:35 PM, Sam S E <asdf mailinator.com> wrote:There are many useful and interesting features that are planned but unimplemented.Thank you; thanks to you I now have a basic understanding of all the features of D. Now if only Walter could implement all of them :) --SamWhat's that supposed to mean?
Nov 23 2008
On Sun, Nov 23, 2008 at 6:48 PM, Sam S E <asdf mailinator.com> wrote:Jarrett Billingsley Wrote:...like what?On Sun, Nov 23, 2008 at 5:35 PM, Sam S E <asdf mailinator.com> wrote:There are many useful and interesting features that are planned but unimplemented.Thank you; thanks to you I now have a basic understanding of all the features of D. Now if only Walter could implement all of them :) --SamWhat's that supposed to mean?
Nov 23 2008
Jarrett Billingsley Wrote:On Sun, Nov 23, 2008 at 6:48 PM, Sam S E <asdf mailinator.com> wrote:See http://s3.amazonaws.com/dconf2007/WalterAndrei.pdf. There are some amazing feature listed there. I can't think of anything else I'd like to see implemented (except for automatic type inference of substructs in struct literals). I don't know how to explain those, so I'll give an example: struct Foo { int a; int b; } struct Bar { Foo f; real asdf; } auto def = Bar(Foo(1, 42), 13.7); //current Bar def = {{1, 42}, 13.7}; //C-style //downside: only possible if you initialize //when you declare auto def = Bar({1, 42}, 13.7); //Bar for clarity, Foo obvious //simpler, especially with many nested structs I've gotten pretty far off topic; this probably deserves it's own thread by now. --SamJarrett Billingsley Wrote:...like what?On Sun, Nov 23, 2008 at 5:35 PM, Sam S E <asdf mailinator.com> wrote:There are many useful and interesting features that are planned but unimplemented.Thank you; thanks to you I now have a basic understanding of all the features of D. Now if only Walter could implement all of them :) --SamWhat's that supposed to mean?
Nov 23 2008
On Sun, Nov 23, 2008 at 10:59 PM, Sam S E <asdf mailinator.com> wrote:See http://s3.amazonaws.com/dconf2007/WalterAndrei.pdf. There are some amazing feature listed there. I can't think of anything else I'd like to see implemented (except for automatic type inference of substructs in struct literals).Ah, OK. Yeah, I wonder if a good number of those features will make it into D anytime soon. Walter already said macros will be put off until D3, which were one of the major things I was looking forward to for D2.. in the mean time, a number of other ideas have come up and have taken precedence over many things mentioned in the slides. Some are already implemented, though.I don't know how to explain those, so I'll give an example: struct Foo { int a; int b; } struct Bar { Foo f; real asdf; } auto def = Bar(Foo(1, 42), 13.7); //current Bar def = {{1, 42}, 13.7}; //C-style //downside: only possible if you initialize //when you declare auto def = Bar({1, 42}, 13.7); //Bar for clarity, Foo obvious //simpler, especially with many nested structsBetter struct literals would be nice.
Nov 23 2008
Jarrett Billingsley Wrote:On Sun, Nov 23, 2008 at 10:59 PM, Sam S E <asdf mailinator.com> wrote:Better in what way? Do you like my syntax or do you have a better one?See http://s3.amazonaws.com/dconf2007/WalterAndrei.pdf. There are some amazing feature listed there. I can't think of anything else I'd like to see implemented (except for automatic type inference of substructs in struct literals).Ah, OK. Yeah, I wonder if a good number of those features will make it into D anytime soon. Walter already said macros will be put off until D3, which were one of the major things I was looking forward to for D2.. in the mean time, a number of other ideas have come up and have taken precedence over many things mentioned in the slides. Some are already implemented, though.I don't know how to explain those, so I'll give an example: struct Foo { int a; int b; } struct Bar { Foo f; real asdf; } auto def = Bar(Foo(1, 42), 13.7); //current Bar def = {{1, 42}, 13.7}; //C-style //downside: only possible if you initialize //when you declare auto def = Bar({1, 42}, 13.7); //Bar for clarity, Foo obvious //simpler, especially with many nested structsBetter struct literals would be nice.
Nov 23 2008
On Mon, Nov 24, 2008 at 12:51 AM, Sam S E <asdf mailinator.com> wrote:Better in what way? Do you like my syntax or do you have a better one?Oh, I was agreeing with you, as well as implying that struct literals in general could be improved.
Nov 23 2008
Jarrett Billingsley Wrote:On Mon, Nov 24, 2008 at 12:51 AM, Sam S E <asdf mailinator.com> wrote:You're right, struct literals need to be updated, but I don't think it's possible to make them any shorter than my suggestion, except maybe a bracket or two; you need to at least specify the type of the whole thing. --SamBetter in what way? Do you like my syntax or do you have a better one?Oh, I was agreeing with you, as well as implying that struct literals in general could be improved.
Nov 24 2008