digitalmars.D - Garbage Collection
- James Dunne (10/10) Dec 28 2004 Can we have a way in Linux to not use the garbage collector at all? I k...
- Nick Sabalausky (5/20) Dec 28 2004 I'm very curious about that too. Perhaps I'm wrong, but it seems to me ...
- Walter (10/18) Dec 29 2004 know in
- James Dunne (5/7) Dec 29 2004 Then how do you free memory allocated with new since there's no delete k...
- Simon Buchan (4/13) Dec 29 2004 Since there's no GC, I expect you wouldn't be able to use
- Walter (8/15) Dec 30 2004 you
- James Dunne (5/21) Jan 02 2005 Can I override the default behaviour of new/delete to use my own memory
- James Dunne (6/32) Jan 02 2005 This just occurred to me... Can we have two memory-management targets fo...
- Walter (7/12) Jan 02 2005 D?
- Walter (4/6) Jan 02 2005 Replace the gc code in the library with your own. All the source is
- Simon Buchan (2/8) Jan 03 2005 Hmm, these two responses by Walter seem to be the wrong way round...
Can we have a way in Linux to not use the garbage collector at all? I know in Windows you have to write your own WinMain() function and explicitly turn on the garbage collector. Can we have some version flag that does this for Linux or some other similar method? I'd like to see what I can do with D without garbage collection. I know gc.disable() works, but I really don't want it to even start up initially. Also, what's the current status on DLLs (and Linux SOs) with D's garbage collector? Regards, James Dunne
Dec 28 2004
I'm very curious about that too. Perhaps I'm wrong, but it seems to me that the ability to opt-out of using the GC would be very beneficial on low-power/embedded devices. "James Dunne" <jdunne4 bradley.edu> wrote in message news:cqt2un$2ico$1 digitaldaemon.com...Can we have a way in Linux to not use the garbage collector at all? I know in Windows you have to write your own WinMain() function and explicitly turn on the garbage collector. Can we have some version flag that does this for Linux or some other similar method? I'd like to see what I can do with D without garbage collection. I know gc.disable() works, but I really don't want it to even start up initially. Also, what's the current status on DLLs (and Linux SOs) with D's garbage collector? Regards, James Dunne
Dec 28 2004
"James Dunne" <jdunne4 bradley.edu> wrote in message news:cqt2un$2ico$1 digitaldaemon.com...Can we have a way in Linux to not use the garbage collector at all? Iknow inWindows you have to write your own WinMain() function and explicitly turnon thegarbage collector. Can we have some version flag that does this for Linuxorsome other similar method? I'd like to see what I can do with D withoutgarbagecollection. I know gc.disable() works, but I really don't want it to evenstartup initially.It's all controlled by the library. Full library source is included, and you can remove the gc by simply deleting it from dmain2.d and rebuilding phobos.Also, what's the current status on DLLs (and Linux SOs) with D's garbage collector?Same as always !
Dec 29 2004
It's all controlled by the library. Full library source is included, and you can remove the gc by simply deleting it from dmain2.d and rebuilding phobos.Then how do you free memory allocated with new since there's no delete keyword? Do I have to go with C's malloc and free? Or just write my own memory management *shudders*? Regards, James Dunne
Dec 29 2004
On Thu, 30 Dec 2004 06:55:32 +0000 (UTC), James Dunne <jdunne4 bradley.edu> wrote:Since there's no GC, I expect you wouldn't be able to use new (runtime exception?) P.S. I thought there was a delete keyword? Am I just stupid?It's all controlled by the library. Full library source is included, and you can remove the gc by simply deleting it from dmain2.d and rebuilding phobos.Then how do you free memory allocated with new since there's no delete keyword? Do I have to go with C's malloc and free? Or just write my own memory management *shudders*? Regards, James Dunne
Dec 29 2004
"James Dunne" <jdunne4 bradley.edu> wrote in message news:cr08p4$2na4$1 digitaldaemon.com...youIt's all controlled by the library. Full library source is included, andphobos.can remove the gc by simply deleting it from dmain2.d and rebuildingkeyword?Then how do you free memory allocated with new since there's no deleteDo I have to go with C's malloc and free? Or just write my own memory management *shudders*?There is a delete keyword! And yes, if you don't wish to use D's automatic memory management code, you'll need to manually manage it yourself. Using C's malloc/free is one way to do it.
Dec 30 2004
In article <cr0i8v$5v$1 digitaldaemon.com>, Walter says..."James Dunne" <jdunne4 bradley.edu> wrote in message news:cr08p4$2na4$1 digitaldaemon.com...Can I override the default behaviour of new/delete to use my own memory management? :):) If so, how and where? Thanks for the info! Regards, James DunneyouIt's all controlled by the library. Full library source is included, andphobos.can remove the gc by simply deleting it from dmain2.d and rebuildingkeyword?Then how do you free memory allocated with new since there's no deleteDo I have to go with C's malloc and free? Or just write my own memory management *shudders*?There is a delete keyword! And yes, if you don't wish to use D's automatic memory management code, you'll need to manually manage it yourself. Using C's malloc/free is one way to do it.
Jan 02 2005
This just occurred to me... Can we have two memory-management targets for D? One garbage collected (default), and the other manually managed with new/delete (compiler switch)? I'm sure you've got some nice C++ memory management code lying around ;) I also know you've got enough on your plate with this language to feed for a few years, so I'm just throwing in my $0.02. In article <cra8mt$pge$1 digitaldaemon.com>, James Dunne says...In article <cr0i8v$5v$1 digitaldaemon.com>, Walter says..."James Dunne" <jdunne4 bradley.edu> wrote in message news:cr08p4$2na4$1 digitaldaemon.com...Can I override the default behaviour of new/delete to use my own memory management? :):) If so, how and where? Thanks for the info! Regards, James DunneyouIt's all controlled by the library. Full library source is included, andphobos.can remove the gc by simply deleting it from dmain2.d and rebuildingkeyword?Then how do you free memory allocated with new since there's no deleteDo I have to go with C's malloc and free? Or just write my own memory management *shudders*?There is a delete keyword! And yes, if you don't wish to use D's automatic memory management code, you'll need to manually manage it yourself. Using C's malloc/free is one way to do it.
Jan 02 2005
"James Dunne" <jdunne4 bradley.edu> wrote in message news:cra9hh$qe0$1 digitaldaemon.com...This just occurred to me... Can we have two memory-management targets forD?One garbage collected (default), and the other manually managed withnew/delete(compiler switch)? I'm sure you've got some nice C++ memory managementcodelying around ;) I also know you've got enough on your plate with thislanguageto feed for a few years, so I'm just throwing in my $0.02.You can override new/delete on a per-class basis.
Jan 02 2005
"James Dunne" <jdunne4 bradley.edu> wrote in message news:cra8mt$pge$1 digitaldaemon.com...Can I override the default behaviour of new/delete to use my own memory management? :):) If so, how and where? Thanks for the info!Replace the gc code in the library with your own. All the source is provided!
Jan 02 2005
On Sun, 2 Jan 2005 22:54:36 -0800, Walter <newshound digitalmars.com> wrote:"James Dunne" <jdunne4 bradley.edu> wrote in message news:cra8mt$pge$1 digitaldaemon.com...Hmm, these two responses by Walter seem to be the wrong way round...Can I override the default behaviour of new/delete to use my own memory management? :):) If so, how and where? Thanks for the info!Replace the gc code in the library with your own. All the source is provided!
Jan 03 2005