[Vm-dev] [OpenSmalltalk/opensmalltalk-vm] 08822c: Revise valid macro for LLP64 case in sqWin32Backtr...

David T. Lewis lewis at mail.msen.com
Thu Jul 7 17:26:29 UTC 2016


What type to declare? That's a very good question and I am not sure the
best answer. I do think it might make sense to come up with a type
declaration for a thing that may store either a sqInt value or a C pointer
value. There are quite a few cases where we need to deal with that problem
throughout the VM and plugins.

Dave


>  OK, I did think of it, but effectively considered it was not maintained
> in
> COG.
> If we really want to re-integrate this, what would be the right type to
> use?
> We can't use long (might be too short), nor sqLong (might be too long).
> Should we create a new type just for this case?
>
> 2016-07-07 18:03 GMT+02:00 David T. Lewis <lewis at mail.msen.com>:
>
>>
>> sqInt is not always large enough to hold a pointer, in particular for
>> the
>> common case of a 64-bit VM running a 32-bit object memory (yes I know
>> there is not currently such a configuration for Cog/Spur). It would be
>> good to avoid that assumption if possible.
>>
>> Dave
>>
>> >    Branch: refs/heads/Cog
>> >   Home:   https://github.com/OpenSmalltalk/opensmalltalk-vm
>> >   Commit: 08822ce610c20b61e1faec0ce72e635c8ad10e7c
>> >
>> https://github.com/OpenSmalltalk/opensmalltalk-vm/commit/08822ce610c20b61e1faec0ce72e635c8ad10e7c
>> >   Author: Nicolas Cellier <nicolas.cellier at sirehna.com>
>> >   Date:   2016-07-07 (Thu, 07 Jul 2016)
>> >
>> >   Changed paths:
>> >     M platforms/win32/vm/sqWin32Backtrace.c
>> >
>> >   Log Message:
>> >   -----------
>> >   Revise valid macro for LLP64 case in sqWin32Backtrace.c
>> >
>> > The code would have truncated fp bits because sizeof(long) >
>> sizeof(fp)
>> in
>> > LLP64
>> > It would have worked because we only inspect least significant bits
>> for
>> > alignment
>> > But it's better to suppress suspicious compiler warning.
>> > Thus use sqInt which is allways large enough to hold a pointer.
>> >
>> >
>> >
>>
>>
>>
>




More information about the Vm-dev mailing list