[Haskell-cafe] mapping large structures into memory

Warren Harris warrensomebody at gmail.com
Fri Sep 25 15:31:29 EDT 2009


On Sep 25, 2009, at 12:14 PM, Don Stewart wrote:

>
> It is entirely possible to use mmap to map structures into memory.
> Thanks to the foreign function interface, there are well-defined
> semantics for calling to and from C.
>
> The key questions would be:
>
> * what is the type and representation of the data you wish to map
> * what operations on them

Right... my question relates more to how well the intrinsic type  
system integrates with foreign/mapped structures. For instance, I  
wouldn't want to create my own foreign arrays, and have to replicate  
all sorts of library code that only works on haskell's intrinsic arrays.

I'm assuming here that all this mapped data is self-contained, and  
doesn't point to heap-allocated structures, although that's a related  
question -- is it possible to inform the gc about heap pointers stored  
(temporarily) in these structures (and later identify them in order to  
swizzle them out when flushing the mapped file to disk).

Warren


More information about the Haskell-Cafe mailing list