[Vm-dev] Why primitive new have unexpected temp affectation

Adrian Lienhard adi at netstyle.ch
Mon Aug 13 11:36:38 UTC 2007


On Aug 13, 2007, at 13:23 , Mathieu Suen wrote:

> On Aug 13, 2007, at 10:08 AM, Adrian Lienhard wrote:
>
>> Hi Mathieu,
>>
>> Not sure if I understand you correctly. Do you mean, why  
>> stackValue: 1 is read twice?
>> The reason for this is because  
>> #sufficientSpaceToInstantiate:indexableSize: may trigger GC (as  
>> the comment says), and therefore the temp pointer to the class,  
>> which is read before, may not be valid anymore.
>
> Why the  GC need to change the temp pointer?
>

It does not change it. And this is exactly the problem when objects  
are moved in memory during the compaction phase.

Adrian


More information about the Vm-dev mailing list