[Vm-dev] preferred version to get 1st indexable field

Bert Freudenberg bert at impara.de
Sat Aug 19 19:47:48 UTC 2006


Am 19.08.2006 um 21:19 schrieb Martin Kuball:

>
> Am Saturday, 19. August 2006 19:56 schrieb Bert Freudenberg:
>> Am 19.08.2006 um 19:25 schrieb Martin Kuball:
>>> What is the preferred version to get the pointer to the first
>>> indexable field of an indexable object:
>>> 	dstStrPointer := interpreterProxy firstIndexableField: string.
>>> or
>>> 	dstStrPointer := interpreterProxy arrayValueOf: string.
>>
>> Depends. #arrayValueOf: works only for non-pointer objects, but is
>> faster. #firstIndexableField: handles everything, including mixed
>> fixed/indexable field object formats.
>
> So for objects of class String or ByteArray I could use the first  
> one and
> for objects of class Array I would use the second one?

Yes.

- Bert -



More information about the Vm-dev mailing list