Heap allocation and internal pointers
Tobias Pankrath
tobias at pankrath.net
Fri Jan 24 04:40:42 PST 2014
On Monday, 20 January 2014 at 20:20:01 UTC, Steven Schveighoffer
wrote:
> On Mon, 20 Jan 2014 14:58:12 -0500, Dmitry Olshansky
> <dmitry.olsh at gmail.com> wrote:
>
>> 20-Jan-2014 23:48, Steven Schveighoffer пишет:
>
>>> I think this is somewhat too general. It can be GC allocated,
>>> even
>>> GC-array allocated. The GC will not move around your array
>>> unexpectedly
>>> without updating the pointers.
>>
>> But a moving collector will happily assume there are no
>> internal pointers when moving and won't update them I bet.
>
> If we have a moving GC, then we must have precise type info on
> every piece of memory that points at the target, otherwise it
> cannot possibly move data unsolicited. Why wouldn't that
> include the internal pointer?
>
> -Steve
I thought internal pointer were forbidden so that we can elide
postblits etc. when moving r-values? What about this use case?
More information about the Digitalmars-d
mailing list