digitalmars.D.learn - On D's garbage collection
- Marcel (9/9) Oct 08 2019 I'm been thinking about using D in conjunction with C11 to
- Ferhat =?UTF-8?B?S3VydHVsbXXFnw==?= (3/12) Oct 08 2019 I think you may find this interesting:
- Ferhat =?UTF-8?B?S3VydHVsbXXFnw==?= (4/17) Oct 08 2019 And the code which is actually working:
- Marcel (3/12) Oct 13 2019 Wonderful, i'll be looking into it. Thank you!
- Max Haughton (11/20) Oct 08 2019 Do you want to write D code that just doesn't use the GC or the
I'm been thinking about using D in conjunction with C11 to develop a set of applications with hard real-time requirements. While initially the goal was to use C++ instead, it has become clear that D's introspection facilities will offer significant advantages. Unfortunately, the project will heavily rely on custom memory allocators written in C, so the presence of garbage collection in the language is a problem. While I'm aware that the nogc attribute exists, I haven't actually seen a way to apply it to a whole project. Is this possible?
Oct 08 2019
On Tuesday, 8 October 2019 at 16:28:51 UTC, Marcel wrote:I'm been thinking about using D in conjunction with C11 to develop a set of applications with hard real-time requirements. While initially the goal was to use C++ instead, it has become clear that D's introspection facilities will offer significant advantages. Unfortunately, the project will heavily rely on custom memory allocators written in C, so the presence of garbage collection in the language is a problem. While I'm aware that the nogc attribute exists, I haven't actually seen a way to apply it to a whole project. Is this possible?I think you may find this interesting: https://www.auburnsounds.com/blog/2016-11-10_Running-D-without-its-runtime.html
Oct 08 2019
On Tuesday, 8 October 2019 at 16:43:23 UTC, Ferhat Kurtulmuş wrote:On Tuesday, 8 October 2019 at 16:28:51 UTC, Marcel wrote:And the code which is actually working: https://github.com/AuburnSounds/Dplug/blob/master/core/dplug/core/nogc.dI'm been thinking about using D in conjunction with C11 to develop a set of applications with hard real-time requirements. While initially the goal was to use C++ instead, it has become clear that D's introspection facilities will offer significant advantages. Unfortunately, the project will heavily rely on custom memory allocators written in C, so the presence of garbage collection in the language is a problem. While I'm aware that the nogc attribute exists, I haven't actually seen a way to apply it to a whole project. Is this possible?I think you may find this interesting: https://www.auburnsounds.com/blog/2016-11-10_Running-D-without-its-runtime.html
Oct 08 2019
On Tuesday, 8 October 2019 at 16:48:55 UTC, Ferhat Kurtulmuş wrote:On Tuesday, 8 October 2019 at 16:43:23 UTC, Ferhat Kurtulmuş wrote:Wonderful, i'll be looking into it. Thank you!On Tuesday, 8 October 2019 at 16:28:51 UTC, Marcel wrote:And the code which is actually working: https://github.com/AuburnSounds/Dplug/blob/master/core/dplug/core/nogc.d[...]I think you may find this interesting: https://www.auburnsounds.com/blog/2016-11-10_Running-D-without-its-runtime.html
Oct 13 2019
On Tuesday, 8 October 2019 at 16:28:51 UTC, Marcel wrote:I'm been thinking about using D in conjunction with C11 to develop a set of applications with hard real-time requirements. While initially the goal was to use C++ instead, it has become clear that D's introspection facilities will offer significant advantages. Unfortunately, the project will heavily rely on custom memory allocators written in C, so the presence of garbage collection in the language is a problem. While I'm aware that the nogc attribute exists, I haven't actually seen a way to apply it to a whole project. Is this possible?Do you want to write D code that just doesn't use the GC or the whole runtime? If the former then use nogc at the entry point of your D code (This means that - say - main cannot call anything non- nogc and therefore guarantees the program is nogc), if the latter then use -betterC IMO, if the interface to your memory allocators is stable then just link with them and write the whole thing in D (Interfacing with C is a solved problem but C is just awful compared to the features you get for free in D)
Oct 08 2019