[colm-users] Hardcoded word_t
Adrian Thurston
thurston at colm.net
Thu May 3 17:12:51 UTC 2018
Hi Konstantin,
code_t is the type used to encode virtual machine instructions. Just
need 1 byte for this now.
half_t is used mostly for virtual machine instruction arguments. It
started out as 2 bytes, but has grown. It might have been made larger
than needed at the moment -- haven't looked at that in long time.
word_t is the primary type for virtual machine values pushed to the
stack and operated on by the VM. The values are either pointers to
things or integers. The VM assumes the same size here, so whatever type
is used it needs to be the same size as a pointer or there will be some
trouble.
Admittedly, portability needs to be improved.
On 2018-04-30 11:34, Konstantin Podsvirov wrote:
> 30.04.2018, 18:06, "Adrian Thurston" <thurston at colm.net>:
>> Hi, yes would like to have this fixed at some point. Sorry no ETA at
>> the moment.
>
> But can you briefly describe what does each type code_t, word_t,
> half_t and what are the requirements in size and made to them.
>
>> On 2018-04-29 12:53, Konstantin Podsvirov wrote:
>>> Hello colm developers... :-)
>>>
>>> Currently the word_t is hardcoded in src/tree.h file as unsigned long
>>> type, bun used to store pointers too.
>>>
>>> On some platform (for example mingw64) size of the long (4 byte) less
>>> then size of the void* (8 byte).
>>>
>>> Previously i add check for this problem in CMake project file, but
>>> not provide any solution.
>>>
>>> What you think about this?
>>>
>>> --
>>> Regards,
>>> Konstantin Podsvirov
>>>
>>> _______________________________________________ colm-users mailing
>>> list colm-users at colm.net
>>> http://www.colm.net/cgi-bin/mailman/listinfo/colm-users
>> ,
>>
>> _______________________________________________
>> colm-users mailing list
>> colm-users at colm.net
>> http://www.colm.net/cgi-bin/mailman/listinfo/colm-users
>
> --
> Regards,
> Konstantin Podsvirov
>
> _______________________________________________
> colm-users mailing list
> colm-users at colm.net
> http://www.colm.net/cgi-bin/mailman/listinfo/colm-users
More information about the colm-users
mailing list