Author: Armin Rigo <[email protected]>
Branch: gc-incminimark-pinning
Changeset: r74072:627e4d900c45
Date: 2014-10-22 14:41 +0200
http://bitbucket.org/pypy/pypy/changeset/627e4d900c45/
Log: Fix fix fix
diff --git a/pypy/module/bz2/interp_bz2.py b/pypy/module/bz2/interp_bz2.py
--- a/pypy/module/bz2/interp_bz2.py
+++ b/pypy/module/bz2/interp_bz2.py
@@ -195,7 +195,7 @@
self._allocate_chunk(initial_size)
def _allocate_chunk(self, size):
- self.raw_buf, self.gc_buf = rffi.alloc_buffer(size)
+ self.raw_buf, self.gc_buf, self.case_num = rffi.alloc_buffer(size)
self.current_size = size
self.bzs.c_next_out = self.raw_buf
rffi.setintfield(self.bzs, 'c_avail_out', size)
@@ -204,8 +204,10 @@
assert 0 <= chunksize <= self.current_size
raw_buf = self.raw_buf
gc_buf = self.gc_buf
- s = rffi.str_from_buffer(raw_buf, gc_buf, self.current_size, chunksize)
- rffi.keep_buffer_alive_until_here(raw_buf, gc_buf)
+ case_num = self.case_num
+ s = rffi.str_from_buffer(raw_buf, gc_buf, case_num,
+ self.current_size, chunksize)
+ rffi.keep_buffer_alive_until_here(raw_buf, gc_buf, case_num)
self.current_size = 0
return s
@@ -225,7 +227,8 @@
def free(self):
if self.current_size > 0:
- rffi.keep_buffer_alive_until_here(self.raw_buf, self.gc_buf)
+ rffi.keep_buffer_alive_until_here(self.raw_buf, self.gc_buf,
+ self.case_num)
def __enter__(self):
return self
diff --git a/rpython/rtyper/lltypesystem/ll2ctypes.py
b/rpython/rtyper/lltypesystem/ll2ctypes.py
--- a/rpython/rtyper/lltypesystem/ll2ctypes.py
+++ b/rpython/rtyper/lltypesystem/ll2ctypes.py
@@ -565,6 +565,8 @@
if addr in ALLOCATED:
raise Exception("internal ll2ctypes error - "
"double conversion from lltype to ctypes?")
+ if self._TYPE._gckind == 'gc':
+ return
# XXX don't store here immortal structures
ALLOCATED[addr] = self
_______________________________________________
pypy-commit mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-commit