[MLton] Callback functions: how?

Wesley W. Terpstra wesley at terpstra.ca
Fri Feb 16 07:44:49 PST 2007


On Feb 14, 2007, at 9:14 PM, Wesley W. Terpstra wrote:
> Vesa Karvonen wrote:
>> Basically, there is a single exported ML callback function and a
>> callback cache for each imported C function that takes callbacks.
>> The key generated by the cache is given to the C side as the
>> context pointer (uarg in your snippet).
> This sounds pretty much the same as my solution, except that my  
> hash function is (fn x => x) and I don't need a collision policy.

Wow. Premature optimization on my part. The overhead of  
MLton_callFromC + thread switching + marshalling completely  
overwhelms any attempt at optimization.

Damn.




More information about the MLton mailing list