is d-runtime non-gc safe?

Hans Uhlig hans.uhlig at teamaol.com
Mon Dec 5 08:34:18 PST 2011


Ok, this is probably a silly question but why are the array appending 
operations dependent on the GC. Why cant you allocate from a fixed pool? 
or can you it just requires writing your own malloc/free implementation?

On 12/5/2011 5:46 AM, Steven Schveighoffer wrote:
> On Sat, 03 Dec 2011 12:43:08 -0500, Marco Leise <Marco.Leise at gmx.de> wrote:
>
>> Am 03.12.2011, 10:01 Uhr, schrieb Benjamin Thaut
>> <code at benjamin-thaut.de>:
>>
>>> Thanks, That doesn't sound to bad. If I manage to get a non leaking
>>> non gc version of d-runtime working would there be any interest in that?
>>>
>>> Kind Regards
>>> Benjamin Thaut
>>
>> That would be most interesting! How do you imagine this could work
>> though? As an example D array slices work on GC memory and you can
>> have dozens of slices on the same memory block. Would these memory
>> blocks be reference counted then?
>
> D array appending operations require a GC. You'd have to avoid them.
> This should be possible with some changes to druntime (just find all the
> cases and remove them).
>
> But what's difficult is finding leaks which don't have any anchor to
> search for. For example, how do you search for code that allocates an
> array and *doesn't* deallocate it?
>
> It's definitely an interesting and worthwhile project.
>
> -Steve



More information about the Digitalmars-d mailing list