[Haskell-cafe] FFI woes!
Keean Schupke
k.schupke at imperial.ac.uk
Thu Dec 16 04:46:34 EST 2004
What about using a StablePtr? If you're dealing with hardware you would
get the
end-of-sample interrupt to free the buffer... Either way you either have
to delay GC
until the sample playback has finished... (well technically until the
soundcard DMA
has transferred the sample to the soundcards onboard memory) or free the
memory
when playback has finished. These ammount to the same thing... but using
a StablePtr
and explicit free seems much nicer than hacking strange stuff into a
finalizer.
Keean.
More information about the Haskell-Cafe
mailing list