[Ur] Generalizing transactions

Marc Weber marco-oweber at gmx.de
Wed Dec 1 10:09:33 EST 2010


Excerpts from Adam Chlipala's message of Wed Dec 01 15:50:26 +0100 2010:
> Yes and no.  The global functions will accomplish what you want.  
> However, pointers allocated by uw_malloc() should not be referenced 
> across requests.  You should use regular malloc() for such memory.  Note 
> that uw_set_global() allows you to specify a function to call to free 
> the value you set; for anything that lasts across requests, you do need 
> to start thinking about explicit freeing.

What does "request" mean exactly?

The user (browser) issues a request. Then urweb will run code and maybe
retry. Therefore its still the same request.

1) request made
2) urweb runs code, C is calling abort (retry)
3) urweb reruns code - this time there is success.

Now will pointers be freed after 2) or after 3)?


More information about the Ur mailing list