[Vm-dev] Re: [squeak-dev] VM 4.4 build nastinesses - part 1 of probably many

tim Rowledge tim at rowledge.org
Tue Feb 12 22:47:57 UTC 2013


On 12-02-2013, at 12:38 PM, Eliot Miranda <eliot.miranda at gmail.com> wrote:

> 
> 
> On Tue, Feb 12, 2013 at 12:30 PM, Eliot Miranda <eliot.miranda at gmail.com> wrote:
> 
> 
> On Tue, Feb 12, 2013 at 11:48 AM, tim Rowledge <tim at rowledge.org> wrote:
> 
> I never knew that you could declare an argument in C with "sqInt (*thingy[])(void)" ! I hope it actually does what i think it oughta.
> 
> yes it does :)
> 
> see e.g. http://stackoverflow.com/questions/5488608/how-define-an-array-of-function-pointers-in-c.  But what's the relevance?  I don't see any obvious candidates in the VM source.  Can you point me to the example?

The primitive table is (or should be) typed as an array of pointers to function with void arg and sqInt return (although I think that likely really ought to be void return, requiring some other fixes in the translator code depths). Following from that you need to suitably match types all over the place - which is why the original slang code wimped out and used int *everywhere* and cast things if really, really needed. Which lead to some really ugly code.
Example - dispatchFunctionPointerOn:in:


tim
--
tim Rowledge; tim at rowledge.org; http://www.rowledge.org/tim
Useful Latin Phrases:- Aio, quantitas magna frumentorum est. = Yes, that is a very large amount of corn.




More information about the Vm-dev mailing list