
16 Dec
2004
16 Dec
'04
4:46 a.m.
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.