A thought about garbage collection
bearophile
bearophileHUGS at lycos.com
Wed Dec 19 17:24:44 PST 2012
jerro:
>> I don't think I've ever actually used it (other than just
>> trying it). When I use classes, I usually want them to be heap
>> allocated.
I think to make a difference for the GC (and to improve locality
for the cache, and reduce the fan out discussed in the blog
post), a good percentage (50%? 70%?) of the class instances need
to be allocated in-place.
I say "in-place", because a fixed-sized array is allocated in
place inside a class instance, even if the instance is allocated
on the heap.
------------------------
deadalnix:
> It is unsafe :D But otherwise works properly.
In this thread there are some notes:
http://d.puremagic.com/issues/show_bug.cgi?id=5115
Maybe some language support is needed to improve the situation.
And this stuff can't want D3. Taking a good look at the design of
Rust language is an option.
> LDC also plan to provide a pass that remove many allocation
> when it can prove that thing don't escape scope. I don't know
> if that went into the lastest version, last time I heard of it
> it was experimental.
Escape analysis helps, but it's not a good enough solution. This
is said in that blog post too.
Bye,
bearophile
More information about the Digitalmars-d
mailing list