[M3devel] munmap in user threads?

Tony Hosking hosking at cs.purdue.edu
Tue Nov 3 16:02:06 CET 2009


No, notice how ss holds the original allocated space.  Whereas uc gets  
the adjusted values for passing to makecontext.

Antony Hosking | Associate Professor | Computer Science | Purdue  
University
305 N. University Street | West Lafayette | IN 47907 | USA
Office +1 765 494 6001 | Mobile +1 765 427 5484




On 3 Nov 2009, at 08:23, Jay K wrote:

> Tony,
>
>
> void DisposeContext (Context **c)
> {
>   if (munmap((*c)->ss.ss_sp, (*c)->ss.ss_size)) abort();
>   free(*c);
>   *c = NULL;
> }
>
> Should that be (char*)ss_sp - pagesize, ss_size + 2 * pagesize?
> Or ok asis?
> Should there be checks for *c == NULL, or ss_sp == NULL?
> I think it is ok -- assuming the data isn't available to safe code  
> that could double dispose it.
>
>  - Jay

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://m3lists.elegosoft.com/pipermail/m3devel/attachments/20091103/903b4b42/attachment-0002.html>


More information about the M3devel mailing list