[Python-checkins] CVS: python/dist/src/Modules mmapmodule.c,2.13,2.14

A.M. Kuchling python-dev@python.org
Sun, 18 Jun 2000 07:51:24 -0700


Update of /cvsroot/python/python/dist/src/Modules
In directory slayer.i.sourceforge.net:/tmp/cvs-serv7045

Modified Files:
	mmapmodule.c 
Log Message:
Support resizing the mapping depending on whether HAVE_MREMAP is defined
Remove two unused variables


Index: mmapmodule.c
===================================================================
RCS file: /cvsroot/python/python/dist/src/Modules/mmapmodule.c,v
retrieving revision 2.13
retrieving revision 2.14
diff -C2 -r2.13 -r2.14
*** mmapmodule.c	2000/06/18 04:45:14	2.13
--- mmapmodule.c	2000/06/18 14:51:21	2.14
***************
*** 335,339 ****
  
  #ifdef UNIX
! #ifndef MREMAP_MAYMOVE
  } else {
  	PyErr_SetString(PyExc_SystemError,
--- 335,339 ----
  
  #ifdef UNIX
! #ifndef HAVE_MREMAP 
  } else {
  	PyErr_SetString(PyExc_SystemError,
***************
*** 344,348 ****
--- 344,352 ----
  	void *newmap;
  
+ #ifdef MREMAP_MAYMOVE
  	newmap = mremap(self->data, self->size, new_size, MREMAP_MAYMOVE);
+ #else
+ 	newmap = mremap(self->data, self->size, new_size, 0);
+ #endif
  	if (newmap == (void *)-1) 
  	{
***************
*** 354,358 ****
  	Py_INCREF(Py_None);
  	return Py_None;
! #endif /* MREMAP_MAYMOVE */
  #endif /* UNIX */
  }
--- 358,362 ----
  	Py_INCREF(Py_None);
  	return Py_None;
! #endif /* HAVE_MREMAP */
  #endif /* UNIX */
  }
***************
*** 775,780 ****
  	int map_size;
  	int fd, flags = MAP_SHARED, prot = PROT_WRITE | PROT_READ;
- 	char * filename;
- 	int namelen;
  	char *keywords[] = {"file", "size", "flags", "prot", NULL};
  
--- 779,782 ----