Hi Alon,

On Sun, 22 May 2016 09:55:09 -0700
Alon Zakai <[email protected]> wrote:

> The best way to do a full reset is just to start all over. You can use
> MODULARIZE to put the entire module in a function, and then you create
> instances by calling the function. You can then drop references to one and
> create another, with a guaranteed pristine memory state.
> 

Thanks! After playing a little with -s MODULARIZE=1 and getting rid of the
global function calls to Emscripten's code , I got it to work. However, as I
discovered, that did not entirely fix my problem because some initial game
layouts caused the solver to run out of memory even given the solver iterations
limit. I ended up catching the exception and resetting the Emscripten generated
code after that.

Thanks again!

        Shlomi

> On Sun, May 22, 2016 at 3:30 AM, Shlomi Fish <[email protected]> wrote:
> 
> > Hi all!
> >
> > I have a problem where running
> > freecell_solver_user_alloc()+freecell_solver_user_solve()+freecell_solver_user_free()
> > (and some other malloc()s/free()s) many times makes Emscripten eventually
> > report (in the console.log) that it cannot malloc memory and my program can
> > no longer be run. I suspect this is caused by memory fragmentation and I'm
> > seeking a way to reset Emscripten's memory so I can start from a clean
> > slate at each iteration. Something like exit()+execve() again in Unix.
> >
> > Can anyone tell me how to do it? My web searches failed for me on that.
> >
> > Regards,
> >
> > -- Shlomi Fish
> >
> > --
> > You received this message because you are subscribed to the Google Groups
> > "emscripten-discuss" group.
> > To unsubscribe from this group and stop receiving emails from it, send an
> > email to [email protected].
> > For more options, visit https://groups.google.com/d/optout.
> >  
> 



-- 
-----------------------------------------------------------------
Shlomi Fish       http://www.shlomifish.org/
http://youtu.be/KxGRhd_iWuE - Never Give Up!!

Chuck Norris is *not* going to miss Anna Kendrick when she’s gone.
    — http://www.shlomifish.org/humour/bits/facts/Chuck-Norris/

Please reply to list if it's a mailing list post - http://shlom.in/reply .

-- 
You received this message because you are subscribed to the Google Groups 
"emscripten-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to