[PATCH] Problems with Cygwin mmap/munmap (mmap.cc) [correctly formatted]

Kelley Cook Kelley.Cook@home.com
Tue Nov 28 12:41:00 GMT 2000


All right Chris, I'll get to work on the copyright assignments ...

In the meantime, here is my first version of corrections, which just ignores
the problem entirely and is therefore extremely short (one line).  Hopefully
short enough to put something in place while the long process of legalness
is sorted out.

It, of course, doesn't fix any of the memory leaks, but it does allows GCC
2.97 to bootstrap by avoiding unmapping memory that might still be used.

Mon Nov 27 21:09:50 2000  Kelley Cook <kelley.cook@home.com>

	* mmap.cc (munmap): Check that mmap and munmap length match.

--- cygwin/mmap.cc.orig	Mon Nov 27 14:14:17 2000
+++ cygwin/mmap.cc.1	Mon Nov 27 16:09:50 2000
@@ -292,7 +292,7 @@ munmap (caddr_t addr, size_t len)
 	  for (li = 0; li < l->nrecs; ++li)
 	    {
 	      mmap_record rec = l->recs[li];
-	      if (rec.get_address () == addr)
+	      if (rec.get_address () == addr && rec.get_size () == len)
 		{
                   int fd = l->fd;
                   fhandler_disk_file fh_paging_file (NULL);





--
Want to unsubscribe from this list?
Send a message to cygwin-unsubscribe@sourceware.cygnus.com



More information about the Cygwin mailing list