Re: Passed by references and by value
Posted by
Marcus Denker-4 on
Sep 26, 2014; 6:24am
URL: https://forum.world.st/Passed-by-references-and-by-value-tp4780289p4780378.html
On 25 Sep 2014, at 20:28, Esteban A. Maringolo <
[hidden email]> wrote:
> 2014-09-25 15:14 GMT-03:00 nacho <
[hidden email]>:
>> Hi,
>> In PBE says that ordinary objects' ivars are passed by references and small
>> integers are passed by value.
>> Is there a way to know if a class is passed by reference or by value?
>
>> Only small integers are passed as value?
>
> Yes.
>
> It has to do with the object headers, SmallIntegers are embedded in the OH.
>
In the *reference*, not the header. The reference points to a header for a normal
object, for small-integers the reference *is* the integer value. This means that
there is no header for the integers.
Marcus