On Fri, Oct 21, 2005 at 03:19:36PM +0100, Joel Reymont wrote:
> Is there a particular reason why StablePtr cannot provide a "fixed"  
> memory address? Then 4 bytes of memory won't need to be allocated so  
> that C could write to them and C could just modify the Haskell variable.

because haskell values don't have the same representation as C values.
haskell values are pointers to updatable thunks. in any case 'with'
just allocates 4 bytes on the stack (the same as a auto C declaration)
so is quite speedy compared to what it would take to make a haskell
value look like a C one. not to mention haskell values can't be
modified.
        John

-- 
John Meacham - ⑆repetae.net⑆john⑈ 
_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe

Reply via email to