[squeak-dev] Re: The method trailer format

Igor Stasenko siguctua at gmail.com
Sat Dec 12 21:32:56 UTC 2009


2009/12/12 Andreas Raab <andreas.raab at gmx.de>:
> Igor Stasenko wrote:
>>
>> k = 111110
>> the trailer is encoded source pointer. Total trailer size is 5-bytes
>>
>> k = 111101
>> the trailer is encoded source pointer. Total trailer size is 6-bytes
>>
>> k = 111100
>> the trailer is encoded source pointer. Total trailer size is 7-bytes
>>
>> k = 111011
>> the trailer is encoded source pointer. Total trailer size is 8-bytes
>
> That's a bit wasteful. You can use a variable length encoding at no const
> for the usual range of source pointers (i.e., use the high-level bit to mean
> that there's another byte to come; this gives you 28 bits range in 4 bytes).
> Keep the other patterns reserved; you don't know what you might want them
> for at a later point.
>

Thanks for paying attention. Really, i could encode integer using
variable length bytes as sequence of:
(flag << 7) + remainder
where flag = 1 means that there is another byte following.

So, i will leave
k = 111110
the trailer is variable-length encoded source pointer.
dd bits is unused and must be 00

> Cheers,
>  - Andreas


-- 
Best regards,
Igor Stasenko AKA sig.



More information about the Squeak-dev mailing list