On Sun, Feb 7, 2016 at 10:19 AM, Cedric St-Jean <[email protected]> wrote:
>
>
> On Sun, Feb 7, 2016 at 9:54 AM, Yichao Yu <[email protected]> wrote:
>>
>> On Sun, Feb 7, 2016 at 9:39 AM, Cedric St-Jean <[email protected]>
>> wrote:
>> > There's an issue on Github to add GC support for stack-allocated
>> > objects,
>> > and that makes no sense to me! Could someone please help me out? In my
>> > mind,
>> > stack-allocated objects = Int+Float+...+Immutable (in some
>> > circumstances). I
>> > thought that with Immutables, if I have
>>
>> by `Int + Float + ...` I think you mean bitstype.
>
>
> Yes.
>
>>
>>
>> > details. Any stack-allocated object gets automatically wiped as the
>> > stack
>> > unwinds, hence does not need GC'ing.
>>
>> s/GC/root/ might be a better word.
>
>
> Agreed.
>
>>
>>
>> >
>> > Then on the `l` line, because it's an Any array, the ImagePos needs to
>> > be
>> > copied, boxed and heap-allocated. So that one needs GC.
>>
>> I'm not really sure what you mean by `needs GC` here. What will happen
>> is that the element of a `Any` array will be heap(GC) allocated
>> (boxed) and so is the Array l itself. Therefore, `l` wiill be GC
>> rooted and elements in the `l` array are reachable by the GC from the
>> array `l`.
>
>
> Yes, that's what I meant.
>
> Could you please explain what the Github issue is about?

Ahh, I didn't realize that `Image` is `!isbits`

The issue is that the current format of our GC frame can only handle
array of pointers so in order to root an object (and therefore objects
that are referenced by it), it has to be boxed.

>
>>
>> >
>> > What did I miss?
>> >
>> > Cédric
>
>

Reply via email to