Re: Garbage Collectors

2023-07-22 Thread Steven Schveighoffer via Digitalmars-d-learn
On 7/19/23 10:46 AM, Johan wrote: On Wednesday, 19 July 2023 at 11:27:14 UTC, Richard (Rikki) Andrew Cattermole wrote: [...] you would have to do a new build of druntime/phobos special which isn't the easiest thing to do. Side remark: LDC ships with the ldc-build-runtime tool which should

Re: Garbage Collectors

2023-07-19 Thread Johan via Digitalmars-d-learn
On Wednesday, 19 July 2023 at 11:27:14 UTC, Richard (Rikki) Andrew Cattermole wrote: [...] you would have to do a new build of druntime/phobos special which isn't the easiest thing to do. Side remark: LDC ships with the ldc-build-runtime tool which should help the user a lot in building

Re: Garbage Collectors

2023-07-19 Thread Steven Schveighoffer via Digitalmars-d-learn
On 7/19/23 3:24 AM, IchorDev wrote: So, D’s default garbage collector is the one named “conservative” in DRuntime… I see there’s also “manual” which doesn’t actually function as a GC, which is interesting. Nothing says what ProtoGC is… so I guess it’s useless. Has anyone ever published any

Re: Garbage Collectors

2023-07-19 Thread IchorDev via Digitalmars-d-learn
On Wednesday, 19 July 2023 at 11:27:14 UTC, Richard (Rikki) Andrew Cattermole wrote: druntime supports registering of GC's not compiled with druntime. But because some of the machinery isn't available to you, you would have to recreate it. Oh right, so it's more of a matter of making

Re: Garbage Collectors

2023-07-19 Thread Richard (Rikki) Andrew Cattermole via Digitalmars-d-learn
On 19/07/2023 11:13 PM, IchorDev wrote: On Wednesday, 19 July 2023 at 10:50:07 UTC, Richard (Rikki) Andrew Cattermole wrote: Copying out the conservative GC, register it under a different name and getting that to compile and link without recompiling druntime would be a good place to begin

Re: Garbage Collectors

2023-07-19 Thread IchorDev via Digitalmars-d-learn
On Wednesday, 19 July 2023 at 10:50:07 UTC, Richard (Rikki) Andrew Cattermole wrote: Copying out the conservative GC, register it under a different name and getting that to compile and link without recompiling druntime would be a good place to begin without having to understand how GC's

Re: Garbage Collectors

2023-07-19 Thread Richard (Rikki) Andrew Cattermole via Digitalmars-d-learn
On 19/07/2023 9:02 PM, IchorDev wrote: On Wednesday, 19 July 2023 at 08:27:18 UTC, Richard (Rikki) Andrew Cattermole wrote: Its not as simple as porting to the API unfortunately. We don't have barriers of any kind, so that removes most GC designs you would want to use today. We are very close

Re: Garbage Collectors

2023-07-19 Thread IchorDev via Digitalmars-d-learn
On Wednesday, 19 July 2023 at 08:27:18 UTC, Richard (Rikki) Andrew Cattermole wrote: Its not as simple as porting to the API unfortunately. We don't have barriers of any kind, so that removes most GC designs you would want to use today. We are very close to maxing out what we can do as a

Re: Garbage Collectors

2023-07-19 Thread Richard (Rikki) Andrew Cattermole via Digitalmars-d-learn
Its not as simple as porting to the API unfortunately. We don't have barriers of any kind, so that removes most GC designs you would want to use today. We are very close to maxing out what we can do as a result. A whole pile of logic is hidden in rt, so you have no choice but to either do

Re: Garbage Collectors

2023-07-19 Thread Richard (Rikki) Andrew Cattermole via Digitalmars-d-learn
On 19/07/2023 7:44 PM, Sergey wrote: Forking GC was introduced some time ago. But I don't think it is quite different from regular (https://forum.dlang.org/post/tf8mbo$1jvp$1...@digitalmars.com) It is a modification of the conservative GC. Rather than a unique GC implementation and is

Re: Garbage Collectors

2023-07-19 Thread Sergey via Digitalmars-d-learn
On Wednesday, 19 July 2023 at 07:24:06 UTC, IchorDev wrote: So, D’s default garbage collector is the one named “conservative” in DRuntime… I see there’s also “manual” which doesn’t actually function as a GC, which is interesting. Nothing says what ProtoGC is… so I guess it’s useless. Has

Re: Memory management and garbage collectors

2010-08-30 Thread JMRyan
Thank you for your reply. It was helpful.

Memory management and garbage collectors

2010-08-28 Thread JMRyan
In theory, garbage collectors make memory leaks a thing of the past. In practice, garbage collectors don't always work according to theory. This makes me curious: how does one test for memory leaks in a D program? I also don't know how smart or dumb garbage collectors are. How much help

Re: Memory management and garbage collectors

2010-08-28 Thread bearophile
JMRyan: In theory, garbage collectors make memory leaks a thing of the past. Even with a perfect GC you may leave around references that keep alive some data that you will never need to use. This is a kind of memory leak. And the current D GC is not fully precise, this means that sometimes