View previous topic :: View next topic |
Author |
Message |
0ffh
Joined: 14 Feb 2007 Posts: 1
|
Posted: Mon Feb 19, 2007 2:29 pm Post subject: Is there a GC'd malloc alternative? |
|
|
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 mem?
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.
[/i] |
|
Back to top |
|
|
Brian
Joined: 08 Mar 2007 Posts: 13 Location: Talent, OR
|
Posted: Fri Mar 23, 2007 11:23 am Post subject: RE: Is there a GC'd malloc alternative? |
|
|
Hope you've found the answer to this by now, but there's one in Tango. I'm using it in my project and it seems to work pretty well.
Brian |
|
Back to top |
|
|
sean
Joined: 24 Jun 2004 Posts: 609 Location: Bay Area, CA
|
Posted: Fri Mar 23, 2007 2:04 pm Post subject: |
|
|
Yup, Tango has gc.malloc(), gc.calloc(), and gc.realloc(). If you're using Phobos, the equivalent is "new void[x]" for memory containing pointers or "new byte[x]" for memory without pointers. |
|
Back to top |
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|