Commits

Erik Grinaker committed 58c0d7a

remove mlocking due to crashes

Comments (0)

Files changed (5)

 New features:
 - translation support
 - ported to gtk+ 2.8 and gnome 2.10
-- use mlock() to ensure memory is never swapped to disk
 - cleaned up preferences dialog
 - only show Revelation files by default in open and save dialogs
 

src/revelation-applet.in

 		gettext.bind_textdomain_codeset(config.PACKAGE, "UTF-8")
 		gettext.textdomain(config.PACKAGE)
 
-		mman.mlockall(mman.MCL_FUTURE)
-
 		try:
 			self.__init_config()
 			self.__init_facilities()

src/revelation.in

 if "@pyexecdir@" not in sys.path:
 	sys.path.insert(0, "@pyexecdir@")
 
-from revelation import config, data, datahandler, dialog, entry, io, mman, ui, util
+from revelation import config, data, datahandler, dialog, entry, io, ui, util
 
 _ = gettext.gettext
 
 		gnome.ui.authentication_manager_init()
 		ui.App.__init__(self, config.APPNAME)
 
-		mman.mlockall(mman.MCL_FUTURE)
-
 		self.connect("delete-event", self.__cb_quit)
 
 		try:

src/wrap/mman/Makefile.am

-## Process this file with automake to produce Makefile.in
-#
-# src/wrap/mman/Makefile.am
-#
-# $Id$
-#
-
-module_PROGRAMS	= mman.so
-moduledir	= $(pyexecdir)/revelation
-
-mman.o: mman.c
-	$(CC) -pthread -fno-strict-aliasing -fPIC -I${PYTHON_INCLUDE} -c mman.c -o mman.o
-
-mman.so: mman.o
-	$(CC) -Wl --export-dynamic -pthread -shared mman.o -o mman.so
-

src/wrap/mman/mman.c

-/*
- *
- *  $Id$
- *  Copyright (C) 2001, Xavier Defrang <xavier_at_defrang_dot_com>
- *
- *  This program is free software; you can redistribute it and/or
- *  modify it under the terms of the GNU General Public License
- *  as published by the Free Software Foundation; either version 2
- *  of the License, or (at your option) any later version.
- *
- *  This program is distributed in the hope that it will be useful,
- *  but WITHOUT ANY WARRANTY; without even the implied warranty of
- *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *  GNU General Public License for more details.
- *
- *  You should have received a copy of the GNU General Public License
- *  along with this program; if not, write to the FSF:
- *
- *      Free Software Foundation, Inc.,
- *      59 Temple Place - Suite 330, Boston, 
- *      MA 02111-1307, USA.
- *
- */
-
-
-#include <Python.h>
-
-#include <sys/mman.h>
-
-
-/* Module Information */
-
-static char __author__[] = "Xavier Defrang <xavier_at_defrang_dot_com>";
-static char __version__[] = "$Revision$";
-
-
-static char mlockall_docstring[] = "Locks in memory all pages mapped by an address space. See mlockall(2) for details.";
-
-static PyObject *mman_mlockall(PyObject *self, PyObject *args)
-{
-	int flags, result;
-	
-	if (!PyArg_ParseTuple(args, "i", &flags)) 
-		return NULL;
-
-	result = mlockall(flags);
-
-	return Py_BuildValue("i", (int)result);
-}
-
-
-static char munlockall_docstring[] = "Removes address space locks and locks on mappings in the address space. See mlockall(2) for details.";
-
-static PyObject *mman_unmlockall(PyObject *self, PyObject *args)
-{
-	int result;
-	
-	result = munlockall();
-
-	return Py_BuildValue("i", (int)result);
-}
-
-/* Module documentation */
-static char mman_docstring[] = "Memory locking functions.";
-
-
-/* Methods */
-static PyMethodDef mman_methods[] = {
-  { "mlockall", mman_mlockall, METH_VARARGS, mlockall_docstring },
-  { "munlockall", mman_unmlockall, 0, munlockall_docstring },
-  { NULL, NULL }  
-};
-
-
-
-/* Module intialization */
-void initmman(void)
-{
-	PyObject *m;
-	PyObject *d;
- 
-	/* Intialize module */
-	m = Py_InitModule3("mman", mman_methods, mman_docstring);
-
-	/* Get module namespace */
-	d = PyModule_GetDict(m);
-
-	/* Declare flags bitmasks */
-	PyDict_SetItemString(d, "MCL_CURRENT", PyInt_FromLong(MCL_CURRENT));
-	PyDict_SetItemString(d, "MCL_FUTURE", PyInt_FromLong(MCL_FUTURE));
-
-	/* Set module information */
-	PyDict_SetItemString(d, "__author__", PyString_FromString(__author__)); 
-	PyDict_SetItemString(d, "__version__", PyString_FromString(__version__)); 
-}
-