It's possible ResourceT from the yesod guys could be quite useful. It
allows you to manually release things, but also ensures that things are
released in case of exceptions. It also supports, from what I can tell,
some kind of reference counting for use with multiple threads (the
deallocator isn't
Sounds hairy. Is there any way to get reference counting garbage collection
in Haskell?
On Tue, Feb 7, 2012 at 9:26 AM, L Corbijn wrote:
> On Tue, Feb 7, 2012 at 5:23 AM, Austin Seipp wrote:
> > Just to clarify, this guarantee possibly could be made, ghc just doesn't
> do
> > it now. In the pas
On Tue, Feb 7, 2012 at 5:23 AM, Austin Seipp wrote:
> Just to clarify, this guarantee possibly could be made, ghc just doesn't do
> it now. In the past ghc never guaranteed a finalizer would ever be run.
>
> Regardless I would be wary of trusting finalizers to clean up very scarce
> resources. A m
Just to clarify, this guarantee possibly could be made, ghc just doesn't do
it now. In the past ghc never guaranteed a finalizer would ever be run.
Regardless I would be wary of trusting finalizers to clean up very scarce
resources. A malloc'd buffer is probably fine to have a finalizer for,
textu
Even the next major, manually triggered GC? I'm just dealing with GHC here,
if that simplifies the discussion.
Although important and good to know, I don't really care what the spec says
here. I just want to know if, with the current implementation of GHC,
finalizeres will be run if a GC is manual
It's a precise GC of course (conservative collection would be madness
considering how much memory Haskell programs chew through.) That still
doesn't ensure your finalizer will run during the next GC even if all the
references are gone by then.
Sent from my iPhone^H^H^H^H^HPortable Turing machine
Is the Haskell garbage collector conservative, or precise?
If it's conservative, then this will only usually work. If it's precise, it
should always work.
On Mon, Feb 6, 2012 at 10:56 PM, Ben Lippmeier wrote:
>
> On 07/02/2012, at 2:50 PM, Clark Gaebel wrote:
>
> > I would be running the GC man
On 07/02/2012, at 2:50 PM, Clark Gaebel wrote:
> I would be running the GC manually at key points to make sure it gets cleaned
> up. Mainly, before any scene changes when basically everything gets thrown
> out anyways.
>From the docs:
newForeignPtr :: FinalizerPtr a -> Ptr a -> IO (ForeignPt
I would be running the GC manually at key points to make sure it gets
cleaned up. Mainly, before any scene changes when basically everything gets
thrown out anyways.
On Mon, Feb 6, 2012 at 10:49 PM, Ben Lippmeier wrote:
>
> On 07/02/2012, at 2:40 PM, Clark Gaebel wrote:
>
> Awesome. Thanks!
>
>
On 07/02/2012, at 2:40 PM, Clark Gaebel wrote:
> Awesome. Thanks!
>
> As a follow up question, how do I add a finalizer to a normal variable?
> OpenGL returns an integer handle to your texture in graphics memory, and you
> have to call deleteObjectNames on it. Is there any way to have this
>
Awesome. Thanks!
As a follow up question, how do I add a finalizer to a normal variable?
OpenGL returns an integer handle to your texture in graphics memory, and
you have to call deleteObjectNames on it. Is there any way to have this
automatically run once we lose all references to this variable (
On 07/02/2012, at 7:00 AM, Clark Gaebel wrote:
> Using the OpenGL package on Hackage, how do I load a texture from an array?
>
> In the red book[1], I see their code using glGenTextures and glBindTexture,
> but I can't find these in the documentation. Are there different functions I
> should b
Thank you both. I'll be sure to try these out.
As a matter of fact, I _am_ using JuicyPixels. I didn't realize there was a
version on github which uses Vector. Thanks for letting me know.
Regards,
- clark
On Mon, Feb 6, 2012 at 5:55 PM, Jason Dagit wrote:
> On Mon, Feb 6, 2012 at 12:00 PM, C
On Mon, Feb 6, 2012 at 12:00 PM, Clark Gaebel
wrote:
> Using the OpenGL package on Hackage, how do I load a texture from an array?
The answer will depend on a few things:
* Which OpenGL package you use, for example OpenGL vs. OpenGLRaw
* What type of 'array' you use.
In the case of the OpenG
Using the OpenGL package on Hackage, how do I load a texture from an array?
In the red book[1], I see their code using glGenTextures and glBindTexture,
but I can't find these in the documentation. Are there different functions
I should be calling?
[1] http://glprogramming.com/red/chapter09.html
_
15 matches
Mail list logo