[M3devel] munmap in user threads?

Jay K jay.krell at cornell.edu
Tue Nov 3 14:23:01 CET 2009


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/ff73dc42/attachment-0001.html>


More information about the M3devel mailing list