[squeak-dev] FFI woes

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

[squeak-dev] FFI woes

keith1y
The problem that MC1.5 has with FFI is not what I thought it was.

The problem is due to the fact that MC1.5 compiles each class definition
twice before it sends #initialize. FFI unfortunately overrides
#doneCompiling and expects everything to be initialized already, which
it isn't.

I beleive Sig has uploaded a fix for ffi to mantis.

Keith


Reply | Threaded
Open this post in threaded view
|

Re: [squeak-dev] FFI woes

Igor Stasenko
2008/4/7 Keith Hodges <[hidden email]>:
> The problem that MC1.5 has with FFI is not what I thought it was.
>
>  The problem is due to the fact that MC1.5 compiles each class definition
> twice before it sends #initialize. FFI unfortunately overrides
> #doneCompiling and expects everything to be initialized already, which it
> isn't.
>
>  I beleive Sig has uploaded a fix for ffi to mantis.
>
Yes i did http://bugs.squeak.org/view.php?id=7006
>  Keith
>
>
>



--
Best regards,
Igor Stasenko AKA sig.

Reply | Threaded
Open this post in threaded view
|

[squeak-dev] Re: FFI woes

Andreas.Raab
In reply to this post by keith1y
Keith Hodges wrote:
> The problem that MC1.5 has with FFI is not what I thought it was.
>
> The problem is due to the fact that MC1.5 compiles each class definition
> twice before it sends #initialize. FFI unfortunately overrides
> #doneCompiling and expects everything to be initialized already, which
> it isn't.

Why would it compile everything twice?

> I beleive Sig has uploaded a fix for ffi to mantis.

A workaround rather, not a fix.

Cheers,
   - Andreas

Reply | Threaded
Open this post in threaded view
|

Re: [squeak-dev] Re: FFI woes

keith1y
Andreas Raab wrote:

> Keith Hodges wrote:
>> The problem that MC1.5 has with FFI is not what I thought it was.
>>
>> The problem is due to the fact that MC1.5 compiles each class
>> definition twice before it sends #initialize. FFI unfortunately
>> overrides #doneCompiling and expects everything to be initialized
>> already, which it isn't.
>
> Why would it compile everything twice?
>
>> I beleive Sig has uploaded a fix for ffi to mantis.
>
> A workaround rather, not a fix.
>
> Cheers,
>   - Andreas
>
>
Because MC1.5'a non atomic loading scheme, begins by taking the old
class definition, and the new class definition, and compiling the union
of the two definitions, in the hope that this will help the majority of
methods to compile successfully. Once all of the methods have compiled,
the final new class definition is compiled.

Keith


Reply | Threaded
Open this post in threaded view
|

[squeak-dev] Re: FFI woes

Andreas.Raab
Keith Hodges wrote:
> Because MC1.5'a non atomic loading scheme, begins by taking the old
> class definition, and the new class definition, and compiling the union
> of the two definitions, in the hope that this will help the majority of
> methods to compile successfully. Once all of the methods have compiled,
> the final new class definition is compiled.

So it first compiles a union of the class defs, all the methods, then
recompiles the class defs and then calls initialize? Is that about it?
That makes it really difficult to work around the problem. Maybe delay
the double recompilation until such a time that we have atomic loading?
(this would fix the problem too since the #doneCompiling: method
wouldn't be active until the final class definition is there).

Cheers,
   - Andreas