D - Is there a GC'd malloc alternative?
- 0ffh (10/10) Feb 19 2007 Hi, I'm new to D but got into it pretty quickly...
- Johan Granberg (6/20) Feb 19 2007 are you sure about the new thing. I think that this code would work.
Hi, I'm new to D but got into it pretty quickly... it's heaven for a lazy old C coder! }:->>> I just wonder if there is no library function that works like 'malloc' but in garbage collected memory? Happy hacking, 0ffh p.s. I am probably not looking for the 'new' operator, as 'new' seems to take only certain types as "argument", not the size of the requested memory chunk, as does 'malloc'.
Feb 19 2007
0ffh wrote:Hi, I'm new to D but got into it pretty quickly... it's heaven for a lazy old C coder! }:->>> I just wonder if there is no library function that works like 'malloc' but in garbage collected memory? Happy hacking, 0ffh p.s. I am probably not looking for the 'new' operator, as 'new' seems to take only certain types as "argument", not the size of the requested memory chunk, as does 'malloc'.are you sure about the new thing. I think that this code would work. new void[SIZE]; where SIZE is an integer representing how large chunk of memory you want to reserve. ps. this newsgroup is all but abandoned use the digitalmars.D instead.
Feb 19 2007