Author: Armin Rigo <[email protected]>
Branch: gc-del
Changeset: r63609:63acca3cc396
Date: 2013-04-25 17:03 +0200
http://bitbucket.org/pypy/pypy/changeset/63acca3cc396/
Log: Adapt rmmap.
diff --git a/rpython/rlib/rmmap.py b/rpython/rlib/rmmap.py
--- a/rpython/rlib/rmmap.py
+++ b/rpython/rlib/rmmap.py
@@ -1,7 +1,7 @@
from rpython.rtyper.tool import rffi_platform
from rpython.rtyper.lltypesystem import rffi, lltype, llmemory
-from rpython.rlib import rposix
+from rpython.rlib import rgc, rposix
from rpython.translator.tool.cbuild import ExternalCompilationInfo
from rpython.rlib.nonconst import NonConstant
@@ -268,6 +268,7 @@
elif _POSIX:
self.fd = -1
self.closed = False
+ rgc.register_finalizer(self.close)
def check_valid(self):
if _MS_WINDOWS:
@@ -315,9 +316,6 @@
c_munmap_safe(self.getptr(0), self.size)
self.setdata(NODATA, 0)
- def __del__(self):
- self.close()
-
def unmapview(self):
UnmapViewOfFile(self.getptr(0))
_______________________________________________
pypy-commit mailing list
[email protected]
http://mail.python.org/mailman/listinfo/pypy-commit