On 12.06.2013 15:38, Juan Manuel Cabo wrote:
On 06/05/2013 10:23 AM, Andrei Alexandrescu wrote:
Reddit:
http://www.reddit.com/r/programming/comments/1fpw2r/dconf_2013_day_2_talk_5_a_precise_garbage/
Hackernews: https://news.ycombinator.com/item?id=5825320
Twitter: https://twitter.com/D_Programming/status/342269600689430529
Facebook: https://www.facebook.com/dlang.org/posts/651801198166898
Youtube: http://youtube.com/watch?v=LQY1m_eT37c
Please drive discussions on the social channels, they help D a lot.
Andrei
Loved this talk.
Thanks.
Would struct have an extra field in memory pointing to the
needed type info? If all of this is implemented, will this
mean that an array of structs will not have their data contiguous
in memory?
A struct allocated on the heap does not need the type info in memory, it
is passed with the call invoked by "new" and it is used to supply the
bitmap of pointers that is copied to the appropriate memory.
Due to the implementation details of arrays, it is a bit different for
them: The memory layout changes slightly depending on the size of the
array, so it is not the allocation that creates the pointer bitmap, but
the array functions call "emplace" to fill the bitmap from an array type
info. The memory layout of the array itself is unchanged.